wp/wp-includes/class-wp.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-includes/class-wp.php	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-includes/class-wp.php	Fri Sep 05 18:52:52 2025 +0200
@@ -545,6 +545,11 @@
 			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() );
+			}
 		}
 
 		/**