WordPress admin: display draft pages in the page attribute drop-down list

For clarity, here is a picture of the box that I'm talking about in this question: Screenshot of post parent dropdown list

Background: I built a relatively complex WP site for a client that looks more like a CMS than a blog and relies on a hierarchy of pages built. (Well, these are actually custom types of messages with a set 'hierarchical' => true)

My question is: can I view the draft (or pending) pages in the Parent Page page's drop-down list of attributes? Without this, this means that each page will live until the entire section is ready - and this is not a suitable solution.

What I tried:

  • Searches for an action that is called to create a list (cannot find it)
  • ( wp_dropdown_pages, )
  • ,

? , , ​​WP, , !!

+5
1

!

. , .
.

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;
}

drafts are included as parents

+6

All Articles