Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created December 15, 2016 13:58
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 SiR-DanieL/0ad6ac0dc4a5a285dff8cdc946ae1f41 to your computer and use it in GitHub Desktop.
Save SiR-DanieL/0ad6ac0dc4a5a285dff8cdc946ae1f41 to your computer and use it in GitHub Desktop.
/**
* Shows a notice in the admin once the bulk action is completed.
*/
function my_bulk_action_admin_notice() {
if ( ! empty( $_REQUEST['bulk_draft_posts'] ) ) {
$drafts_count = intval( $_REQUEST['bulk_draft_posts'] );
printf(
'<div id="message" class="updated fade">' .
_n( '%s post moved to drafts.', '%s posts moved to drafts.', $drafts_count, 'domain' )
. '</div>',
$drafts_count
);
}
}
add_action( 'admin_notices', 'my_bulk_action_admin_notice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment