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”.
1 2 3 4 5 6 7 8 9 10 11 12 13 | function custom_post_status(){ 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' ); |
Hope this tutorial help you. Please do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: custom Post Status, wordpress custom post type, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners