By: Prem Tiwari | Last Updated:
If you want to add a custom post status in the post edit screen and page edit screen. It will also add on the quick edit option for post & page listing page.
This is a very simple & easy code to add custom post status & page status.
Copy the below code and add it to the end of the functions.php file to set the custom post status. In the below code, we are going to create a custom post status as “Archived”.
register_post_status( 'archived', array(
'label' => _x( 'Archived', 'post' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Archived <span class="count">(%s)</span>',
'Archived <span class="count">(%s)</span>' ),
add_action( 'init', 'custom_post_status' );
Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby. View all posts by Prem Tiwari