Issue
For clarity - here is a picture of the box I am talking about in this question:
Background: I have built a relatively complex WP site for a client which is more of a CMS than a blog and relies on a hierarchy of pages being built. (Well, they're actually custom post types with 'hierarchical' => true
set)
My question: is it possible to show draft (or pending review) pages in the page attributes 'Parent page' dropdown list? Without this, it means making each page live before the whole section is ready - and that's not a suitable solution.
What I've tried:
- Looking for an action which gets called to build the list (can't find one)
- Looking in the source code for where the list is created (it's built with wp_dropdown_pages which doesn't appear to let you choose the post status)
- Looking for plugins which provide this functionality
Solution
Very nice question!
The following does it. One filter is for the edit page screen and the other for the Quick Edit menu.
Tested with a hierarchical custom post type.
add_filter( 'page_attributes_dropdown_pages_args', 'so_3538267_enable_drafts_parents' );
add_filter( 'quick_edit_dropdown_pages_args', 'so_3538267_enable_drafts_parents' );
function so_3538267_enable_drafts_parents( $args )
{
$args['post_status'] = 'draft,publish,pending';
return $args;
}
Answered By - brasofilo
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.