Skip to content

Instantly share code, notes, and snippets.

@MickeyKay
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MickeyKay/5d87bbdcd4b163f4ba2f to your computer and use it in GitHub Desktop.
Save MickeyKay/5d87bbdcd4b163f4ba2f to your computer and use it in GitHub Desktop.
[WordPress] Include private, draft, and pending posts in parent dropdowns (single post, bulk edit, and quick edit views).
add_filter( 'page_attributes_dropdown_pages_args', 'my_slug_show_all_parents' );
add_filter( 'quick_edit_dropdown_pages_args', 'my_slug_show_all_parents' );
/**
* Show all parents, regardless of post status.
*
* @since 1.0.0
*
* @param array $args Original get_pages() $args.
*
* @return array $args Args set to also include posts with pending, draft, and private status.
*/
function my_slug_show_all_parents( $args ) {
$args['post_status'] = array( 'publish', 'pending', 'draft', 'private' );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment