Last active
August 29, 2015 14:06
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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