Custom post status not appearing

wordpress, wordpress-theming

Solution

Custom post status functionality is still under development (as it has been for the past four years!), see https://core.trac.wordpress.org/ticket/12706, and comments on https://wordpress.stackexchange.com/q/67655/25765. More useful info here: https://wordpress.stackexchange.com/search?q=register_post_status.

Personally, I'd strongly discourage implementing custom post statuses, but if really necessary, you could take a look at how the Edit Flow plugin handles it.

Problem

I am building a directory theme for a client of mine, and I like to add the feature of expiration in the posts by modifying the post status from publish to expired. To achieve that, I am trying to register a new post status by using the following code: ``` add_action('init', 'registerStatus', 0); function registerStatus() { $args = array( 'label' => _x('Expired', 'Status General Name', 'z' ), 'label_count' => _n_noop('Expired (%s)', 'Expired (%s)', 'z'), 'public' => true, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'exclude_from_search' => true ); register_post_status('expired', $args); } ``` The problem is that I cannot see the registered post status either in WordPress posts, either in my custom post type post statuses. Am I doing something wrong?

Original source