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.



git-svn-id: https://develop.svn.wordpress.org/trunk@56462 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein
2023-08-24 20:48:40 +00:00
parent f085426605
commit a84270a1b0

View File

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