Customizer: use the correct `X-Robots-Tag` header.

Fix an issue where the `X-Robots` header was used instead of the `X-Robots-Tag` header.  Using `X-Robots-Tag` yields the correct behavior that the original code intended to add. `X-Robots` is left in place for backward compatibility.

Props michelleblanchette, dhruvishah2203, rajinsharwar, jorbin, hztyfoon, elrae. 

Fixes #58865.


Built from https://develop.svn.wordpress.org/trunk@56462


git-svn-id: http://core.svn.wordpress.org/trunk@55974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2023-08-24 20:50:17 +00:00
parent ee4230d5f8
commit 553f886d61
2 changed files with 2 additions and 1 deletions

View File

@ -1909,6 +1909,7 @@ final class WP_Customize_Manager {
if ( ! headers_sent() ) { if ( ! headers_sent() ) {
nocache_headers(); nocache_headers();
header( 'X-Robots: noindex, nofollow, noarchive' ); header( 'X-Robots: noindex, nofollow, noarchive' );
header( 'X-Robots-Tag: noindex, nofollow, noarchive' );
} }
add_filter( 'wp_robots', 'wp_robots_no_robots' ); add_filter( 'wp_robots', 'wp_robots_no_robots' );
add_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) ); add_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56461'; $wp_version = '6.4-alpha-56462';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.