Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.