How to Add a Custom Post Status to Quick Edit
I think you can find a lot of good information about status creation in WP. But I didn’t find any notes about how to add a status (custom status, you just created) into inline post edit.

So, I mean this dropdown list:

As you can see, there are only 4 WordPress default common statuses. And when you create your own status with register_post_status()
function, it won’t 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' );
Okay, let’s stop talking and start doing this. I want to show you the code which allows you to add your custom post status into quick edit dropdown.
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>";
}
Some comments for the code:
- Insert it to you theme
functions.php
file. If you know what to do — insert it anywhere you want. - For beginners — if your
functions.php
is empty, first of all add on the first line:<?php
. 1-3
.admin_footer-edit.php
action hook means that the code will be processed only on Postwp-admin/edit.php
, Pageswp-admin/edit.php?post_type=page
and Custom Post Type pageswp-admin/edit.php?post_type={custom post type}
in administration area.6
. Is anybody noticed that I didn’t use jQueryeach()
function? But why? Because quick edit HTML template just one for all posts.

I also recomment you to add the following hook into your functions.php
to display the custom post status label like this:

The code:
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 it. Please leave comment if you have a question.
Thanks for reading.

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
You are missing the part where you select the right value for the new status, you might wanna check teh step 4 of this tutorial for that! http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu
Thanks! This is EXACTLY what I was looking for and seems to work for me just fine (not sure about what Jorge’s comment is regarding so maybe I missed something). By the way, I am combining this with code I found to add the custom post status to the regular edit screen as well. (ref: http://stackoverflow.com/questions/20298346/custom-post-status-not-appearing)
thanks ,I think it is problem of wordpress
Hi,
Three years later – this still seems to be a problem.
I am currently trying to add a custom status (Approved / Rejected) to the Product Post Type created by Woocommerce.
First I registered the Status by using this code:
Then I tried to get it to show in quick edit using this code:
It showed in Posts but not in products. Is this method working with WordPress 4.9.4?
Hi,
Did you try
admin_footer
action hook?Thank you so much! Its really awesome. Really kills my pain
Can you also tell me how to change the color of status of each post?
Hey,
What do you mean?
Hi, is there a way to display a green dot on the public page when the status is published and switch to a red dot when the status is a custom one ?
And yes I would really appreciate to know how this could be done :(
I want to display 50 persons who offer services. And when they are unavailable (holiday), i want to change their status easily displaying a green or red dot icon next to the the title/picture in the directory of persons and inside their profile, so inside the post.
Thanks a lot
Hey Fulvio,
Sure, you can do it just with a simple
IF-ELSE
statement:But make sure, that you’re running this code within a loop. If not, you have to pass a post ID variable into the function
get_post_status( $post_id )
.Thanks a lot I’ll try it !! :)
that is awesome, thank you so much :)
but when edit a post, I can’t see new status here
http://prntscr.com/kh489d
do you have any solution?
I think that you will need to a Jquery to add it there.
I havent tried that but see if it works and if you have any problems, let me know.
Jake.
Absolutely written content , thankyou for selective information .
Simply wish to say your article is as amazing. The clarity in your post is simply nice and i could assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.