Skip to content

Commit 4e46f01

Browse files
committed
Fix #8592: Include private pages in parent dropdown for users with read_private_posts capability
1 parent a463271 commit 4e46f01

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/wp-admin/includes/class-wp-posts-list-table.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,10 @@ public function inline_edit() {
18851885
'sort_column' => 'menu_order, post_title',
18861886
);
18871887

1888+
if ( current_user_can( $post_type_object->cap->read_private_posts ) ) {
1889+
$dropdown_args['post_status'] = array( 'publish', 'private' );
1890+
}
1891+
18881892
if ( $bulk ) {
18891893
$dropdown_args['show_option_no_change'] = __( '— No Change —' );
18901894
$dropdown_args['id'] = 'bulk_edit_post_parent';

src/wp-admin/includes/meta-boxes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,11 @@ function page_attributes_meta_box( $post ) {
10121012
'echo' => 0,
10131013
);
10141014

1015+
$post_type_object = get_post_type_object( $post->post_type );
1016+
if ( current_user_can( $post_type_object->cap->read_private_posts ) ) {
1017+
$dropdown_args['post_status'] = array( 'publish', 'private' );
1018+
}
1019+
10151020
/**
10161021
* Filters the arguments used to generate a Pages drop-down element.
10171022
*

0 commit comments

Comments
 (0)