Skip to content

Instantly share code, notes, and snippets.

@davisshaver
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davisshaver/4a836562441f5a6907f2 to your computer and use it in GitHub Desktop.
Save davisshaver/4a836562441f5a6907f2 to your computer and use it in GitHub Desktop.
Snippet for adding a basic Publishing Checklist
<?php
add_action( 'publishing_checklist_init', function() {
$args = array(
'label' => esc_html__( 'Featured Image', 'demo_publishing_checklist' ),
'callback' => function ( $post_id, $id ) {
return has_post_thumbnail( $post_id );
},
'explanation' => esc_html__( 'A featured image is required.', 'demo_publishing_checklist' ),
'post_type' => array( 'post' ),
);
Publishing_Checklist()->register_task( 'demo-featured-image', $args );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment