0

I've been googling around, and struggle to find any solutions on how to add custom post status.

Id like to add 2 a new status called "unread"

I've seen the codex explaining how to register a new post_type like so:

function my_custom_post_status(){
    register_post_status( 'unread', array(
        'label'                     => __( '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' );

... But that does not actually add it to the admin interfaces (as explaining in the codex).

So until they integrate this fully, i need a different solution.

I wouldn't mind if i could just re-label the existing status options.

Would it be possible to re-label 'draft' to 'unread' across the admin screens?

  • 1
    A number of admin interfaces are hardcoded to return the default statuses regardless of what you do. The post status system in WordPress is not exactly fully formed and you'll no doubt encounter bugs. Refer to the edit flow plugin for examples of working around this – Tom J Nowell Sep 24 '14 at 16:53
1

A number of admin interfaces are hardcoded to return the default statuses regardless of what you do. The post status system in WordPress is not exactly fully formed and you'll no doubt encounter bugs. Refer to the edit flow plugin for examples of working around this

  • Yeah- i looked through the code and it does look hard-coded several places. I think this feature would allow more plugins to use the official wordpress post type UI more often, instead of creating new tables in the database, or hacking a "fake" post table together – Malibur Sep 24 '14 at 20:21
  • It's more that the UI doesn't acknowledge the post statuses, but plugins like edit flow replace those parts. Perhaps installing and activating that plugin or extracting the relevant parts is all you need to do. Post status stuff was slated for a recent version of WordPress ( 3.6 I believe ), but didn't make it as it was much more work than expected – Tom J Nowell Sep 24 '14 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.