Skip to content

Instantly share code, notes, and snippets.

@wkw
Created October 25, 2016 18:23
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkw/f32b1391b94aa0db459e1fe01a379b66 to your computer and use it in GitHub Desktop.
Save wkw/f32b1391b94aa0db459e1fe01a379b66 to your computer and use it in GitHub Desktop.
WordPress: allow draft, private posts to be selected in Parent page dropdown
/**
* Show draft and private pages in hierarchicial Parent pages dropdown.
* will work for any hier. post type.
*/
function filter_attributes_dropdown_pages_args($dropdown_args) {
$dropdown_args['post_status'] = array('publish','draft', 'private');
return $dropdown_args;
}
add_filter('page_attributes_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1);
add_filter( 'quick_edit_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment