How to Add Custom Post Status to WordPress Quick Edit
Photo on Unsplash
You’ve probably already found plenty of great information about creating statuses in WordPress. However, not many tutorials explain how to add your custom status (the one you just created) into the WordPress inline post Quick Edit menu.
In this article, Mangcoding will guide you on how to add a custom post status to WordPress Quick Edit, so you can easily manage it. Let’s get started!

Take a look at the image below to better understand the purpose of this article:

As you can see from the image above, there are only 4 standard default statuses in WordPress. And when you create your own status using the `register_post_status()` function, it won’t automatically appear there.
function rudr_custom_status_creation(){
register_post_status( 'featured', array(
'label' => _x( 'Featured', 'post' ), // I used only minimum of parameters
'label_count' => _n_noop( 'Featured <span class="count">(%s)</span>', 'Featured <span class="count">(%s)</span>'),
'public' => true
));
}
add_action( 'init', 'rudr_custom_status_creation' );
Alright, now let’s add your custom post status to the Quick Edit dropdown. Here’s the code you can use:
add_action('admin_footer-edit.php','rudr_status_into_inline_edit');
function rudr_status_into_inline_edit() { // ultra-simple example
echo "<script>
jQuery(document).ready( function() {
jQuery( 'select[name=\"_status\"]' ).append( '<option value=\"featured\">Featured</option>' );
});
</script>";
}
Explanation of the code above:
- Add this code to your theme’s functions.php file. Or, if you know where else to place it, feel free to do so.
- For beginners — if your functions.php file is empty, first add
- admin_footer-edit.php hook ensures the code only runs on the post list page (wp-admin/edit.php), page list (wp-admin/edit.php?post_type=page), or custom post type admin pages.
- 6. Notice we didn’t use the jQuery each() function? Why? Because the Quick Edit HTML template is shared for all posts, so one is enough.

We also recommend adding the following hook to your functions.php to display your custom post status label, like this:

function rudr_display_status_label( $statuses ) {
global $post; // we need it to check current post status
if( get_query_var( 'post_status' ) != 'featured' ){ // not for pages with all posts of this status
if( $post->post_status == 'featured' ){ // если статус поста - Архив
return array('Featured'); // returning our status label
}
}
return $statuses; // returning the array with default statuses
}
add_filter( 'display_post_states', 'rudr_display_status_label' );
That’s all Mangcoding can share about how to add a custom post status to WordPress Quick Edit. Hopefully, this article is helpful and provides new insights for you. If you have constructive feedback or suggestions, feel free to leave a comment or reach out via Mangcoding’s Email and social media.
Source : Rudrastyh.com