mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-20 19:56:49 +01:00
Posts, Post Types: Add no-cache headers to password protected posts.
This instructs an intermediate cache, for example a proxy server, to not cache a password protected post both before and after a visitor has entered a password. Props brevilo, haozi, ironprogrammer, narenin Fixes #61711 Built from https://develop.svn.wordpress.org/trunk@59728 git-svn-id: http://core.svn.wordpress.org/trunk@59070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7b5f5f727a
commit
87d88ab387
|
|
@ -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() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user