From 75e8caddc794fc00aa64312491f83178133aa67f Mon Sep 17 00:00:00 2001 From: Vedanshmini26 <97348795+Vedanshmini26@users.noreply.github.com> Date: Thu, 9 Apr 2026 12:48:44 +0530 Subject: [PATCH 1/4] Fix #8592: Include private pages in parent dropdown for users with read_private_posts capability --- src/wp-admin/includes/class-wp-posts-list-table.php | 4 ++++ src/wp-admin/includes/meta-boxes.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index c7d10fca217ef..cf1ff8bd476d2 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -1885,6 +1885,10 @@ public function inline_edit() { 'sort_column' => 'menu_order, post_title', ); + if ( current_user_can( $post_type_object->cap->read_private_posts ) ) { + $dropdown_args['post_status'] = array( 'publish', 'private' ); + } + if ( $bulk ) { $dropdown_args['show_option_no_change'] = __( '— No Change —' ); $dropdown_args['id'] = 'bulk_edit_post_parent'; diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php index 0884c110b65bd..e5425a1cd6f41 100644 --- a/src/wp-admin/includes/meta-boxes.php +++ b/src/wp-admin/includes/meta-boxes.php @@ -1012,6 +1012,11 @@ function page_attributes_meta_box( $post ) { 'echo' => 0, ); + $post_type_object = get_post_type_object( $post->post_type ); + if ( current_user_can( $post_type_object->cap->read_private_posts ) ) { + $dropdown_args['post_status'] = array( 'publish', 'private' ); + } + /** * Filters the arguments used to generate a Pages drop-down element. * From 3919716e70779c87bc1accb59f515a73e1b7b667 Mon Sep 17 00:00:00 2001 From: Vedanshmini26 <97348795+Vedanshmini26@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:13:40 +0530 Subject: [PATCH 2/4] Feature #37522: Add wp_lostpassword_form() function for embedding the lost password form anywhere --- src/wp-includes/general-template.php | 101 +++++++++++++++++++++++++++ src/wp-login.php | 32 ++------- 2 files changed, 107 insertions(+), 26 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 47e2aeb2ebb05..e2de8969d65f3 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -651,6 +651,107 @@ function wp_login_form( $args = array() ) { } } +/** + * Outputs or returns the lost password form for use anywhere on a WordPress site. + * + * @since 7.1.0 + * + * @param array $args { + * Optional. Array of arguments to control the form output. Default empty array. + * + * @type bool $echo Whether to display the form or return the output. Default true. + * @type string $redirect URL to redirect to after submitting the form. Default empty string. + * @type string $form_id ID attribute for the form element. Default 'lostpasswordform'. + * @type string $id_username ID attribute for the username input. Default 'user_login'. + * @type string $id_submit ID attribute for the submit button. Default 'wp-submit'. + * @type string $label_username Label for the username input. Default 'Username or Email Address'. + * @type string $label_submit Label for the submit button. Default 'Get New Password'. + * } + * @return void|string Void if 'echo' argument is true, lost password form HTML if 'echo' is false. + */ +function wp_lostpassword_form( $args = array() ) { + $defaults = array( + 'echo' => true, + 'redirect' => '', + 'form_id' => 'lostpasswordform', + 'id_username' => 'user_login', + 'id_submit' => 'wp-submit', + 'label_username' => __( 'Username or Email Address' ), + 'label_submit' => __( 'Get New Password' ), + ); + + /** + * Filters the default lost password form arguments. + * + * @since 7.1.0 + * + * @see wp_lostpassword_form() + * + * @param array $defaults An array of default lost password form arguments. + */ + $args = wp_parse_args( $args, apply_filters( 'lostpassword_form_defaults', $defaults ) ); + + $user_login = ''; + if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) { + $user_login = wp_unslash( $_POST['user_login'] ); + } + + /** + * Filters content to display at the top of the lost password form. + * + * The filter evaluates just following the opening form tag element. + * + * @since 7.1.0 + * + * @param string $content Content to display. Default empty. + * @param array $args Array of lost password form arguments. + */ + $lostpassword_form_top = apply_filters( 'lostpassword_form_top', '', $args ); + + /** + * Filters content to display at the bottom of the lost password form. + * + * The filter evaluates just preceding the closing form tag element. + * + * @since 7.1.0 + * + * @param string $content Content to display. Default empty. + * @param array $args Array of lost password form arguments. + */ + $lostpassword_form_bottom = apply_filters( 'lostpassword_form_bottom', '', $args ); + + ob_start(); + ?> +
+ +

+ + +

+ + +

+ +

+ +
+ true, + 'redirect' => $redirect_to, + ) + ); ?> -
-

- - -

- - -

- -

-
-