Custom post status not working

The post status values seems to be hardcoded in the core. Here’s the status box code for the edit screen:

<span id="post-status-display">
<?php
switch ( $post->post_status ) {
        case 'private':
                _e('Privately Published');
                break;
        case 'publish':
                _e('Published');
                break;
        case 'future':
                _e('Scheduled');
                break;
        case 'pending':
                _e('Pending Review');
                break;
        case 'draft':
        case 'auto-draft':
                _e('Draft');
                break;
}
?>
</span>

The Codex says:

NOTICE: This function does NOT add the registered post status to the
admin panel. This functionality is pending future development. Please
refer to Trac Ticket #12706. Consider the action hook
post_submitbox_misc_actions for adding this parameter.

The #12706 ticket was created 5 years ago!

So I don’t think this is currently supported by the core.

If you manually change the status of a post, to a registered custom post status, then you will see it among the tabs on the edit.php screen.

Testing on WP 4.1:

When I try out the Codex example:

function my_custom_post_status(){
        register_post_status( 'unread', array(
                'label'                     => _x( 'Unread', 'post' ),
                'public'                    => true,
                'exclude_from_search'       => false,
                'show_in_admin_all_list'    => true,
                'show_in_admin_status_list' => true,
                'label_count'               => _n_noop( 'Unread <span class="count">(%s)</span>', 'Unread <span class="count">(%s)</span>' ),
        ) );
}
add_action( 'init', 'my_custom_post_status' );

and manually modify the post status of a post to unread, then the status for that post is not showing in the meta-box:

Missing status

On the other hand it shows in tabs on the edit.php screen:

Shows in the edit.php tabs

Leave a Comment