How can I set a draft page as parent without publishing?

Anyone know a way round this?

http://wordpress.org/support/topic/set-draft-page-as-parent

Read More

I can’t risk publishing as a public-facing system updates periodically from the same install.

Related posts

Leave a Reply

6 comments

  1. This works for me:

    add_filter('page_attributes_dropdown_pages_args', 'my_attributes_dropdown_pages_args', 1, 1);
    
    function my_attributes_dropdown_pages_args($dropdown_args) {
    
        $dropdown_args['post_status'] = array('publish','draft');
    
        return $dropdown_args;
    }
    
  2. There is one way to do this, but it’s kind of wonky. Instead of not publishing the page, you can hide the content.

    Make a theme template named HidePageTemplate.php. On the page you want hidden change your template file to whatever you named your template
    In the template copy the structure of the 404 page. This way the page is published, so the child pages are published, but the content isn’t visible.

    /*
    Template Name: Hide Page Template
    */
    get header
    404-Not Found
    get sidebar
    get footer

  3. I am facing the same problem, and the only solution I can think of without having to hide to content or edit the php (as previously suggested) is this:

    Create all of the pages as drafts and once they are ready to be published, publish them and immediately go back in and change the child pages to the correct parent page.

  4. When using Gutenberg Editor, you can use the rest_page_query filter and add the draft status in the query parameters :

    add_filter('rest_page_query', 'my_attributes_dropdown_pages_args', 1, 1);
    
    function my_attributes_dropdown_pages_args($dropdown_args) {
        $dropdown_args['post_status'] = ['publish', 'draft'];
        return $dropdown_args;
    }