apply_filters( 'bulk_post_updated_messages', array[] $bulk_messages, int[] $bulk_counts )

Filters the bulk action updated messages.


By default, custom post types use the messages for the ‘post’ post type.

Top ↑


$bulk_messages array[]
Arrays of messages, each keyed by the corresponding post type. Messages are keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'.
$bulk_counts int[]
Array of item counts for each message, used to build internationalized strings.

Top ↑

More Information

Available in WP 3.7+. That does not mean you have to specifically check for WP version before using this filter, no errors happen when using non-existent filters.

Top ↑


File: wp-admin/edit.php. View all references

$bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts );

Top ↑


Version Description
3.7.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Steven Lin

    Example migrated from Codex:

    The following example adds custom bulk action updated messages for ‘my_cpt’ post type (cpt being an abbreviation for “custom post type”):

    add_filter( 'bulk_post_updated_messages', 'my_bulk_post_updated_messages_filter', 10, 2 );
    function my_bulk_post_updated_messages_filter( $bulk_messages, $bulk_counts ) {
        $bulk_messages['my_cpt'] = array(
            'updated'   => _n( '%s my_cpt updated.', '%s my_cpts updated.', $bulk_counts['updated'] ),
            'locked'    => _n( '%s my_cpt not updated, somebody is editing it.', '%s my_cpts not updated, somebody is editing them.', $bulk_counts['locked'] ),
            'deleted'   => _n( '%s my_cpt permanently deleted.', '%s my_cpts permanently deleted.', $bulk_counts['deleted'] ),
            'trashed'   => _n( '%s my_cpt moved to the Trash.', '%s my_cpts moved to the Trash.', $bulk_counts['trashed'] ),
            'untrashed' => _n( '%s my_cpt restored from the Trash.', '%s my_cpts restored from the Trash.', $bulk_counts['untrashed'] ),
        return $bulk_messages;

You must log in before being able to contribute a note or feedback.