Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts

The check is invoked after a call to get_option( ‘wypiekacz_allow_skip_rules’ ). When you filter pre_option_wypiekacz_allow_skip_rules and returns something different than FALSE, it should stop the check early. Not tested. add_filter( ‘pre_option_wypiekacz_allow_skip_rules’, ‘wpse_100503_wypiekacz_for_drafts_only’ ); function wpse_100503_wypiekacz_for_drafts_only( $bool ) { if ( ‘draft’ === get_post_status( $GLOBALS[‘post’] ) ) return $bool; return 0; } To prevent the post … Read more

Show ‘add comment’ link for status updates in Twenty Thirteen

Open up the /wp-content/themes/twentythirteen/functions.php file and change the line $format_prefix = ( has_post_format( ‘chat’ ) || has_post_format( ‘status’ ) ) ? _x( ‘%1$s on %2$s’, ‘1: post format name. 2: date’, ‘twentythirteen’ ): ‘%2$s’; to $format_prefix = ( has_post_format( ‘chat’ ) || has_post_format( ‘status’ ) ) ? _x( ‘%1$s on %2$s – show/leave comments’, ‘1: … Read more

How to Show Different Information to your authors/contributers

We will use the admin_notices hook to display the information on top of the editor. First, a very basic example function educadme_fill_then_save_admin_notice(){ global $pagenow; if ( $pagenow == ‘post.php’ || $pagenow == ‘post-new.php’ ) { echo ‘<div class=”alert”> <p>This is some text. You can embed images, videos, whatever, and they will display on top of … Read more

Get new (not old) post inside transition_post_status hook

According to the Codex, if you use wp_transition_post_status() you will get both the old version and the new version. wp_transition_post_status( $new_status, $old_status, $post ) The ticket also says that the post type needs to support revisions for the save to work. Check the post type of the post objects before doing anything. If your post … Read more