diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index ce88c102cf..f2b114e708 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -545,6 +545,11 @@ class WP { if ( $post && pings_open( $post ) ) { $headers['X-Pingback'] = get_bloginfo( 'pingback_url', 'display' ); } + + // Send nocache headers for password protected posts to avoid unwanted caching. + if ( ! empty( $post->post_password ) ) { + $headers = array_merge( $headers, wp_get_nocache_headers() ); + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index cec0d1c708..a892673925 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59727'; +$wp_version = '6.8-alpha-59728'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.