WordPress include private pages in parent dropdown
WordPress only includes published pages in the parent page dropdown, I ran into an issue where both parent and child page were made private so work could be done to the pages, the child pages when edited lost their parent relationship, due to the parent page no longer appearing within the “Parent” dropdown.
Why would you need this?
In my case we wanted to make some changes to the existing pages but needed to do these changes in private until all where complete, it was not until after we re-published the pages, we found the child pages where no longer link to the parent.
Let’s add the private and pending pages to the parent dropdown menu, allowing us to pre-create pages and child / parent relationships without having to already have published the pages.
$args['post_status'] = ['publish', 'private', 'pending', 'draft'];
This code is provided as it and may require changes to work for your needs.