From 08e16ca35d102600692eab4e8cc71ab4c594bc8a Mon Sep 17 00:00:00 2001 From: Hug0-Drelon Date: Thu, 5 Mar 2026 16:53:59 +0100 Subject: [PATCH] Force visibility to password when post_password is set. --- src/wp-admin/includes/post.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index de5aa4fb7d0fa..f31b82c795381 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -301,6 +301,11 @@ function edit_post( $post_data = null ) { } } + // Password visibility. + if ( ! empty( $post_data['post_password'] ) ) { + $post_data['visibility'] = 'password'; + } + if ( isset( $post_data['visibility'] ) ) { switch ( $post_data['visibility'] ) { case 'public':