Created
November 3, 2022 14:08
-
-
Save Web-Assembler/0ff99ef9a60b30588e15e2376c41cc29 to your computer and use it in GitHub Desktop.
WordPress - Add private/draft/future/pending pages to parent dropdown when setting page parent in the Page Attributes/Quick Editor
This file contains hidden or 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
<?php | |
/** | |
* Add private/draft/future/pending pages to parent dropdown when setting | |
* page parent in the Page Attributes/Quick Editor | |
* | |
* @since 3.3.0 | |
* | |
* @see wp_dropdown_pages() | |
* | |
* @param array $dropdown_args Array of arguments used to generate the pages drop-down. | |
* @param WP_Post $post The current post. | |
*/ | |
function weba_dropdown_pages_change_args( $dropdown_args, $post ) { | |
$dropdown_args['post_status'] = array( 'publish', 'private' ); | |
return $dropdown_args; | |
} | |
add_filter( 'page_attributes_dropdown_pages_args', 'weba_dropdown_pages_change_args', 10, 2 ); | |
add_filter( 'quick_edit_dropdown_pages_args', 'weba_dropdown_pages_change_args' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment