0

I have added some custom post status to WordPress, I can able display in New and Edit interfaces of POST. I would like to display those to quick edit too. Also I need to apply some condition to display custom status, I will explain with example.

Example : I have created status below 1)status-1 2)status-2

"status-1" appear in the drop-down box only if current post status is 'pending'.

"status-2" appear in the drop-down box only if current post status is 'status-1'.

Thanks in advance.

0

2 Answers 2

1

Unfortunately there are no filters or actions for modifying the post status select in quick edit (WP_Posts_List_Table::inline_edit()) - you'd need to resort to JavaScript:

(function($){
    $( "select[name=_status]" ).each(
        function () {
            var value = $( this ).val();
            if ( value === "pending" )
                $( "option[value=pending]", this ).after( "<option value='status-1'>Status 1</option>" );
            else if ( value === "status-1" )
                $( "option[value=status-1]", this ).after( "<option value='status-2'>Status 2</option>" );

        }
    );
})(jQuery);
1
  • Thak you I will try this, I think I need to do some work on this code as this code need to call each time a user click on quick edit.
    – Dipu R
    Commented Feb 24, 2014 at 13:37
0

Have a look below urls. It's a pretty detailed tutorial but can be quite involved, don't forget to check the comments area.

http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu http://www.janes.co.za/add-to-custom-post-type-quick-edit-on-wordpress/

May this help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.