From 1ddd28fed75a1ecd2de069dbfec57dc682b29410 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 8 Jul 2026 09:58:57 +0200 Subject: [PATCH 01/22] remove sitemap stylesheets --- src/wp-includes/canonical.php | 4 +- .../sitemaps/class-wp-sitemaps-renderer.php | 105 +----- .../sitemaps/class-wp-sitemaps-stylesheet.php | 317 ------------------ .../sitemaps/class-wp-sitemaps.php | 24 +- src/wp-settings.php | 1 - tests/phpunit/tests/canonical/sitemaps.php | 12 - tests/phpunit/tests/query/vars.php | 1 - .../tests/sitemaps/wpSitemapsRenderer.php | 91 ----- .../tests/sitemaps/wpSitemapsStylesheet.php | 43 --- 9 files changed, 8 insertions(+), 590 deletions(-) delete mode 100644 src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php delete mode 100644 tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php index 6b8c17c07d55a..3882a1d5c2600 100644 --- a/src/wp-includes/canonical.php +++ b/src/wp-includes/canonical.php @@ -706,9 +706,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { } // Remove trailing slash for robots.txt or sitemap requests. - if ( is_robots() - || ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) ) - ) { + if ( is_robots() || ! empty( get_query_var( 'sitemap' ) ) ) { $redirect['path'] = untrailingslashit( $redirect['path'] ); } diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 10a1ef1e7fcd5..cf49f58868556 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -16,105 +16,6 @@ */ #[AllowDynamicProperties] class WP_Sitemaps_Renderer { - /** - * XSL stylesheet for styling a sitemap for web browsers. - * - * @since 5.5.0 - * - * @var string - */ - protected $stylesheet = ''; - - /** - * XSL stylesheet for styling a sitemap for web browsers. - * - * @since 5.5.0 - * - * @var string - */ - protected $stylesheet_index = ''; - - /** - * WP_Sitemaps_Renderer constructor. - * - * @since 5.5.0 - */ - public function __construct() { - $stylesheet_url = $this->get_sitemap_stylesheet_url(); - - if ( $stylesheet_url ) { - $this->stylesheet = ''; - } - - $stylesheet_index_url = $this->get_sitemap_index_stylesheet_url(); - - if ( $stylesheet_index_url ) { - $this->stylesheet_index = ''; - } - } - - /** - * Gets the URL for the sitemap stylesheet. - * - * @since 5.5.0 - * - * @global WP_Rewrite $wp_rewrite WordPress rewrite component. - * - * @return string The sitemap stylesheet URL. - */ - public function get_sitemap_stylesheet_url() { - global $wp_rewrite; - - $sitemap_url = home_url( '/wp-sitemap.xsl' ); - - if ( ! $wp_rewrite->using_permalinks() ) { - $sitemap_url = home_url( '/?sitemap-stylesheet=sitemap' ); - } - - /** - * Filters the URL for the sitemap stylesheet. - * - * If a falsey value is returned, no stylesheet will be used and - * the "raw" XML of the sitemap will be displayed. - * - * @since 5.5.0 - * - * @param string $sitemap_url Full URL for the sitemaps XSL file. - */ - return apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url ); - } - - /** - * Gets the URL for the sitemap index stylesheet. - * - * @since 5.5.0 - * - * @global WP_Rewrite $wp_rewrite WordPress rewrite component. - * - * @return string The sitemap index stylesheet URL. - */ - public function get_sitemap_index_stylesheet_url() { - global $wp_rewrite; - - $sitemap_url = home_url( '/wp-sitemap-index.xsl' ); - - if ( ! $wp_rewrite->using_permalinks() ) { - $sitemap_url = home_url( '/?sitemap-stylesheet=index' ); - } - - /** - * Filters the URL for the sitemap index stylesheet. - * - * If a falsey value is returned, no stylesheet will be used and - * the "raw" XML of the sitemap index will be displayed. - * - * @since 5.5.0 - * - * @param string $sitemap_url Full URL for the sitemaps index XSL file. - */ - return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url ); - } - /** * Renders a sitemap index. * @@ -146,9 +47,8 @@ public function render_index( $sitemaps ) { public function get_sitemap_index_xml( $sitemaps ) { $sitemap_index = new SimpleXMLElement( sprintf( - '%1$s%2$s%3$s', + '%1$s%2$s', '', - $this->stylesheet_index, '' ) ); @@ -210,9 +110,8 @@ public function render_sitemap( $url_list ) { public function get_sitemap_xml( $url_list ) { $urlset = new SimpleXMLElement( sprintf( - '%1$s%2$s%3$s', + '%1$s%2$s', '', - $this->stylesheet, '' ) ); diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php deleted file mode 100644 index 1bf10327b2ffc..0000000000000 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ /dev/null @@ -1,317 +0,0 @@ -get_sitemap_stylesheet(); - } - - if ( 'index' === $type ) { - // All content is escaped below. - echo $this->get_sitemap_index_stylesheet(); - } - - exit; - } - - /** - * Returns the escaped XSL for all sitemaps, except index. - * - * @since 5.5.0 - */ - public function get_sitemap_stylesheet() { - $css = $this->get_stylesheet_css(); - $title = esc_xml( __( 'XML Sitemap' ) ); - $description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) ); - $learn_more = sprintf( - '%s', - esc_url( __( 'https://www.sitemaps.org/' ) ), - esc_xml( __( 'Learn more about XML sitemaps.' ) ) - ); - - $text = sprintf( - /* translators: %s: Number of URLs. */ - esc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ), - '' - ); - - $lang = get_language_attributes( 'html' ); - $url = esc_xml( __( 'URL' ) ); - $lastmod = esc_xml( __( 'Last Modified' ) ); - $changefreq = esc_xml( __( 'Change Frequency' ) ); - $priority = esc_xml( __( 'Priority' ) ); - - $xsl_content = << - - - - - - - - - - - - - {$title} - - - -
-
-

{$title}

-

{$description}

-

{$learn_more}

-
-
-

{$text}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$url}{$lastmod}{$changefreq}{$priority}
-
-
- - -
-
- -XSL; - - /** - * Filters the content of the sitemap stylesheet. - * - * @since 5.5.0 - * - * @param string $xsl_content Full content for the XML stylesheet. - */ - return apply_filters( 'wp_sitemaps_stylesheet_content', $xsl_content ); - } - - /** - * Returns the escaped XSL for the index sitemaps. - * - * @since 5.5.0 - */ - public function get_sitemap_index_stylesheet() { - $css = $this->get_stylesheet_css(); - $title = esc_xml( __( 'XML Sitemap' ) ); - $description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) ); - $learn_more = sprintf( - '%s', - esc_url( __( 'https://www.sitemaps.org/' ) ), - esc_xml( __( 'Learn more about XML sitemaps.' ) ) - ); - - $text = sprintf( - /* translators: %s: Number of URLs. */ - esc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ), - '' - ); - - $lang = get_language_attributes( 'html' ); - $url = esc_xml( __( 'URL' ) ); - $lastmod = esc_xml( __( 'Last Modified' ) ); - - $xsl_content = << - - - - - - - - - - - {$title} - - - -
-
-

{$title}

-

{$description}

-

{$learn_more}

-
-
-

{$text}

- - - - - - - - - - - - - - - - - - - -
{$url}{$lastmod}
-
-
- - -
-
- -XSL; - - /** - * Filters the content of the sitemap index stylesheet. - * - * @since 5.5.0 - * - * @param string $xsl_content Full content for the XML stylesheet. - */ - return apply_filters( 'wp_sitemaps_stylesheet_index_content', $xsl_content ); - } - - /** - * Gets the CSS to be included in sitemap XSL stylesheets. - * - * @since 5.5.0 - * - * @return string The CSS. - */ - public function get_stylesheet_css() { - $text_align = is_rtl() ? 'right' : 'left'; - - $css = <<render_stylesheet( $stylesheet_type ); - exit; - } - // Render the index. if ( 'index' === $sitemap ) { $sitemap_list = $this->index->get_sitemap_list(); diff --git a/src/wp-settings.php b/src/wp-settings.php index 7e951681e4d53..ba52d0178cd3d 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -378,7 +378,6 @@ require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-provider.php'; require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-registry.php'; require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-renderer.php'; -require ABSPATH . WPINC . '/sitemaps/class-wp-sitemaps-stylesheet.php'; require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-posts.php'; require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-taxonomies.php'; require ABSPATH . WPINC . '/sitemaps/providers/class-wp-sitemaps-users.php'; diff --git a/tests/phpunit/tests/canonical/sitemaps.php b/tests/phpunit/tests/canonical/sitemaps.php index 97fa6c4ee8937..1ec0c8a0a81ee 100644 --- a/tests/phpunit/tests/canonical/sitemaps.php +++ b/tests/phpunit/tests/canonical/sitemaps.php @@ -20,12 +20,6 @@ public function test_remove_trailing_slashes_for_sitemap_index_requests() { $this->assertCanonical( '/wp-sitemap.xml/', '/wp-sitemap.xml' ); } - public function test_remove_trailing_slashes_for_sitemap_index_stylesheet_requests() { - $this->set_permalink_structure( '/%postname%/' ); - $this->assertCanonical( '/wp-sitemap-index.xsl', '/wp-sitemap-index.xsl' ); - $this->assertCanonical( '/wp-sitemap-index.xsl/', '/wp-sitemap-index.xsl' ); - } - public function test_remove_trailing_slashes_for_sitemap_requests() { $this->set_permalink_structure( '/%postname%/' ); $this->assertCanonical( '/wp-sitemap-posts-post-1.xml', '/wp-sitemap-posts-post-1.xml' ); @@ -34,12 +28,6 @@ public function test_remove_trailing_slashes_for_sitemap_requests() { $this->assertCanonical( '/wp-sitemap-users-1.xml/', '/wp-sitemap-users-1.xml' ); } - public function test_remove_trailing_slashes_for_sitemap_stylesheet_requests() { - $this->set_permalink_structure( '/%postname%/' ); - $this->assertCanonical( '/wp-sitemap.xsl', '/wp-sitemap.xsl' ); - $this->assertCanonical( '/wp-sitemap.xsl/', '/wp-sitemap.xsl' ); - } - /** * Ensure sitemaps redirects work as expected with pretty permalinks. * diff --git a/tests/phpunit/tests/query/vars.php b/tests/phpunit/tests/query/vars.php index 87e7fa7bb75c6..f4b5f6a695b11 100644 --- a/tests/phpunit/tests/query/vars.php +++ b/tests/phpunit/tests/query/vars.php @@ -73,7 +73,6 @@ public function testPublicQueryVarsAreAsExpected() { 'rest_route', 'sitemap', 'sitemap-subtype', - 'sitemap-stylesheet', ), $wp->public_query_vars, diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index 8ab5e5e3ba827..6b98be1f68458 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -5,46 +5,6 @@ */ class Tests_Sitemaps_wpSitemapsRenderer extends WP_Test_XML_TestCase { - public function test_get_sitemap_stylesheet_url() { - $sitemap_renderer = new WP_Sitemaps_Renderer(); - $stylesheet_url = $sitemap_renderer->get_sitemap_stylesheet_url(); - - $this->assertStringEndsWith( '/?sitemap-stylesheet=sitemap', $stylesheet_url ); - } - - public function test_get_sitemap_stylesheet_url_pretty_permalinks() { - // Set permalinks for testing. - $this->set_permalink_structure( '/%year%/%postname%/' ); - - $sitemap_renderer = new WP_Sitemaps_Renderer(); - $stylesheet_url = $sitemap_renderer->get_sitemap_stylesheet_url(); - - // Clean up permalinks. - $this->set_permalink_structure(); - - $this->assertStringEndsWith( '/wp-sitemap.xsl', $stylesheet_url ); - } - - public function test_get_sitemap_index_stylesheet_url() { - $sitemap_renderer = new WP_Sitemaps_Renderer(); - $stylesheet_url = $sitemap_renderer->get_sitemap_index_stylesheet_url(); - - $this->assertStringEndsWith( '/?sitemap-stylesheet=index', $stylesheet_url ); - } - - public function test_get_sitemap_index_stylesheet_url_pretty_permalinks() { - // Set permalinks for testing. - $this->set_permalink_structure( '/%year%/%postname%/' ); - - $sitemap_renderer = new WP_Sitemaps_Renderer(); - $stylesheet_url = $sitemap_renderer->get_sitemap_index_stylesheet_url(); - - // Clean up permalinks. - $this->set_permalink_structure(); - - $this->assertStringEndsWith( '/wp-sitemap-index.xsl', $stylesheet_url ); - } - /** * Test XML output for the sitemap index renderer. */ @@ -71,7 +31,6 @@ public function test_get_sitemap_index_xml() { $actual = $renderer->get_sitemap_index_xml( $entries ); $expected = '' . - '' . '' . 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml' . 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml' . @@ -114,7 +73,6 @@ public function test_get_sitemap_index_xml_with_lastmod() { $actual = $renderer->get_sitemap_index_xml( $entries ); $expected = '' . - '' . '' . 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml2005-01-01' . 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml2005-01-01' . @@ -160,30 +118,6 @@ public function test_get_sitemap_index_xml_extra_elements() { ); } - /** - * Test XML output for the sitemap index renderer when stylesheet is disabled. - */ - public function test_get_sitemap_index_xml_without_stylesheet() { - $entries = array( - array( - 'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml', - ), - ); - - add_filter( 'wp_sitemaps_stylesheet_index_url', '__return_false' ); - - $renderer = new WP_Sitemaps_Renderer(); - - $xml_dom = $this->loadXML( $renderer->get_sitemap_index_xml( $entries ) ); - $xpath = new DOMXPath( $xml_dom ); - - $this->assertSame( - 0, - $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length, - 'Sitemap index incorrectly contains the xml-stylesheet processing instruction.' - ); - } - /** * Test XML output for the sitemap page renderer. */ @@ -210,7 +144,6 @@ public function test_get_sitemap_xml() { $actual = $renderer->get_sitemap_xml( $url_list ); $expected = '' . - '' . '' . 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1' . 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-2' . @@ -222,30 +155,6 @@ public function test_get_sitemap_xml() { $this->assertXMLEquals( $expected, $actual, 'Sitemap page markup incorrect.' ); } - /** - * Test XML output for the sitemap page renderer when stylesheet is disabled. - */ - public function test_get_sitemap_xml_without_stylesheet() { - $url_list = array( - array( - 'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1', - ), - ); - - add_filter( 'wp_sitemaps_stylesheet_url', '__return_false' ); - - $renderer = new WP_Sitemaps_Renderer(); - - $xml_dom = $this->loadXML( $renderer->get_sitemap_xml( $url_list ) ); - $xpath = new DOMXPath( $xml_dom ); - - $this->assertSame( - 0, - $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length, - 'Sitemap incorrectly contains the xml-stylesheet processing instruction.' - ); - } - /** * Test that all children of Q{http://www.sitemaps.org/schemas/sitemap/0.9}url in the * rendered sitemap XML are defined in the Sitemaps spec (i.e., loc, lastmod, changefreq, priority). diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php deleted file mode 100644 index b4dab08e48eee..0000000000000 --- a/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php +++ /dev/null @@ -1,43 +0,0 @@ -get_sitemap_stylesheet(); - - $this->assertSame( '', $content, 'Could not filter stylesheet content' ); - } - - /** - * Test that sitemap index stylesheet content can be filtered. - */ - public function test_filter_sitemaps_stylesheet_index_content() { - $stylesheet = new WP_Sitemaps_Stylesheet(); - - add_filter( 'wp_sitemaps_stylesheet_index_content', '__return_empty_string' ); - $content = $stylesheet->get_sitemap_index_stylesheet(); - - $this->assertSame( '', $content, 'Could not filter sitemap index stylesheet content' ); - } - - /** - * Test that sitemap stylesheet CSS can be filtered. - */ - public function test_filter_sitemaps_stylesheet_css() { - $stylesheet = new WP_Sitemaps_Stylesheet(); - - add_filter( 'wp_sitemaps_stylesheet_css', '__return_empty_string' ); - $css = $stylesheet->get_stylesheet_css(); - - $this->assertSame( '', $css, 'Could not filter sitemap stylesheet CSS' ); - } -} From b4906d48fb86ae617a0770519522ad4d51778a2c Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 12 Sep 2026 17:46:05 +0000 Subject: [PATCH 02/22] adjust peters comments --- .../sitemaps/class-wp-sitemaps-renderer.php | 24 +++++++ .../sitemaps/class-wp-sitemaps-stylesheet.php | 64 +++++++++++++++++++ src/wp-settings.php | 1 + 3 files changed, 89 insertions(+) create mode 100644 src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index cf49f58868556..3ae1daf9b44ec 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -16,6 +16,30 @@ */ #[AllowDynamicProperties] class WP_Sitemaps_Renderer { + /** + * Gets the URL for the sitemap stylesheet. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @return string Empty string. + */ + public function get_sitemap_stylesheet_url() { + return ''; + } + + /** + * Gets the URL for the sitemap index stylesheet. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @return string Empty string. + */ + public function get_sitemap_index_stylesheet_url() { + return ''; + } + /** * Renders a sitemap index. * diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php new file mode 100644 index 0000000000000..97c75a2f11bf2 --- /dev/null +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -0,0 +1,64 @@ + Date: Sat, 12 Sep 2026 17:56:39 +0000 Subject: [PATCH 03/22] resolve conflict for class-wp-sitemaps.php --- .../sitemaps/class-wp-sitemaps.php | 74 ++++++++++++++++--- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps.php b/src/wp-includes/sitemaps/class-wp-sitemaps.php index 765a5c641bd9e..87b3765b3f2e3 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps.php @@ -135,6 +135,11 @@ public function register_rewrites() { // Register index route. add_rewrite_rule( '^wp-sitemap\.xml$', 'index.php?sitemap=index', 'top' ); + // Register rewrites for the XSL stylesheet. + add_rewrite_tag( '%sitemap-stylesheet%', '([^?]+)' ); + add_rewrite_rule( '^wp-sitemap\.xsl$', 'index.php?sitemap-stylesheet=sitemap', 'top' ); + add_rewrite_rule( '^wp-sitemap-index\.xsl$', 'index.php?sitemap-stylesheet=index', 'top' ); + // Register routes for providers. add_rewrite_rule( '^wp-sitemap-([a-z]+?)-([a-z\d_-]+?)-(\d+?)\.xml$', @@ -152,27 +157,51 @@ public function register_rewrites() { * Renders sitemap templates based on rewrite rules. * * @since 5.5.0 - * - * @global WP_Query $wp_query WordPress Query object. */ public function render_sitemaps() { - global $wp_query; + /* + * Bail early if this isn't a sitemap or stylesheet route. + * + * This runs on every front-end request, so it comes before any + * sanitizing. The raw query vars are tested here, matching + * WP::handle_404(), which exempts sitemap requests from its own 404 on + * the same basis. Testing the sanitized values instead would let a + * request that handle_404() exempted fall through both, leaving it a 200. + */ + if ( ! get_query_var( 'sitemap' ) && ! get_query_var( 'sitemap-stylesheet' ) ) { + return; + } - $sitemap = sanitize_text_field( get_query_var( 'sitemap' ) ); - $object_subtype = sanitize_text_field( get_query_var( 'sitemap-subtype' ) ); - $paged = absint( get_query_var( 'paged' ) ); + $sitemap = sanitize_text_field( get_query_var( 'sitemap' ) ); + $object_subtype = sanitize_text_field( get_query_var( 'sitemap-subtype' ) ); + $stylesheet_type = sanitize_text_field( get_query_var( 'sitemap-stylesheet' ) ); + $paged = absint( get_query_var( 'paged' ) ); - // Bail early if this isn't a sitemap route. - if ( ! $sitemap ) { + // Force a 404 and bail early if the route did not survive sanitizing. + if ( ! ( $sitemap || $stylesheet_type ) ) { + $this->send_404(); return; } if ( ! $this->sitemaps_enabled() ) { - $wp_query->set_404(); - status_header( 404 ); + $this->send_404(); return; } + // Render stylesheet if this is stylesheet route. + if ( $stylesheet_type ) { + // Force a 404 and bail early if the stylesheet type is not recognized. + if ( ! in_array( $stylesheet_type, array( 'sitemap', 'index' ), true ) ) { + $this->send_404(); + return; + } + + $stylesheet = new WP_Sitemaps_Stylesheet(); + + $stylesheet->render_stylesheet( $stylesheet_type ); + exit; + } + // Render the index. if ( 'index' === $sitemap ) { $sitemap_list = $this->index->get_sitemap_list(); @@ -183,7 +212,9 @@ public function render_sitemaps() { $provider = $this->registry->get_provider( $sitemap ); + // Force a 404 and bail early if the requested provider is not registered. if ( ! $provider ) { + $this->send_404(); return; } @@ -195,8 +226,7 @@ public function render_sitemaps() { // Force a 404 and bail early if no URLs are present. if ( empty( $url_list ) ) { - $wp_query->set_404(); - status_header( 404 ); + $this->send_404(); return; } @@ -204,6 +234,26 @@ public function render_sitemaps() { exit; } + /** + * Sends a 404 for a sitemap route that cannot be served. + * + * WP::handle_404() exempts sitemap requests, so every sitemap 404 is issued + * here instead. That includes the no-cache headers handle_404() sends with + * its own 404, so an intermediary does not retain a 404 for a route that + * becomes valid once the site has more content. + * + * @since 7.1.1 + * + * @global WP_Query $wp_query WordPress Query object. + */ + private function send_404(): void { + global $wp_query; + + $wp_query->set_404(); + status_header( 404 ); + nocache_headers(); + } + /** * Redirects a URL to the wp-sitemap.xml * From 99baabed9b3f330a2250d6e774ec716ca1ebdab5 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 12 Sep 2026 21:42:47 +0200 Subject: [PATCH 04/22] fix phpstan error Co-authored-by: Weston Ruter --- .../sitemaps/class-wp-sitemaps-stylesheet.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index d1aeb2aee73de..987cca808df84 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -25,7 +25,15 @@ class WP_Sitemaps_Stylesheet { * @param string $type Stylesheet type. Either 'sitemap' or 'index'. * @return never */ - public function render_stylesheet( $type ) {} + public function render_stylesheet( $type ) { + wp_die( + sprintf( + __( 'Function %1$s is deprecated since version %2$s with no alternative available.' ), + __METHOD__, + '7.2.0' + ) + ); + } /** * Returns the stylesheet for all sitemaps, except index. From 6018a1fb2d0c747981b4e6b86f2558b02a4c9372 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 12 Sep 2026 21:42:58 +0200 Subject: [PATCH 05/22] restore filter Co-authored-by: Weston Ruter --- .../sitemaps/class-wp-sitemaps-renderer.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 3ae1daf9b44ec..746676aa79618 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -25,6 +25,18 @@ class WP_Sitemaps_Renderer { * @return string Empty string. */ public function get_sitemap_stylesheet_url() { + /** + * Filters the URL for the sitemap stylesheet. + * + * If a falsey value is returned, no stylesheet will be used and + * the "raw" XML of the sitemap will be displayed. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @param string $sitemap_url Full URL for the sitemaps XSL file. + */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_url', array( $sitemap_url ), '7.2.0' ); return ''; } From 78a50fbe0f2fccb8b48e6d8c4648f604675a8439 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 12 Sep 2026 19:52:09 +0000 Subject: [PATCH 06/22] add deprecated filter --- src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 5 ++++- src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 746676aa79618..74f6ed3d8ddef 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -36,7 +36,8 @@ public function get_sitemap_stylesheet_url() { * * @param string $sitemap_url Full URL for the sitemaps XSL file. */ - apply_filters_deprecated( 'wp_sitemaps_stylesheet_url', array( $sitemap_url ), '7.2.0' ); + apply_filters_deprecated( 'wp_sitemaps_stylesheet_url', array( '' ), '7.2.0' ); + return ''; } @@ -49,6 +50,8 @@ public function get_sitemap_stylesheet_url() { * @return string Empty string. */ public function get_sitemap_index_stylesheet_url() { + apply_filters_deprecated( 'wp_sitemaps_stylesheet_index_url', array( '' ), '7.2.0' ); + return ''; } diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 987cca808df84..687ae6e5b38d6 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -68,6 +68,8 @@ public function get_sitemap_index_stylesheet() { * @return string Empty string. */ public function get_stylesheet_css() { + apply_filters_deprecated( 'wp_sitemaps_stylesheet_css', array( '' ), '7.2.0' ); + return ''; } } From 2fe990060f4681e76928267e6188858154bb2e90 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 17 Sep 2026 19:52:58 +0000 Subject: [PATCH 07/22] Restore deprecation notices and docblocks for stylesheet no-op methods. --- .../sitemaps/class-wp-sitemaps-renderer.php | 11 +++++++++ .../sitemaps/class-wp-sitemaps-stylesheet.php | 23 +++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 74f6ed3d8ddef..5e86a07bd4051 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -50,6 +50,17 @@ public function get_sitemap_stylesheet_url() { * @return string Empty string. */ public function get_sitemap_index_stylesheet_url() { + /** + * Filters the URL for the sitemap index stylesheet. + * + * If a falsey value is returned, no stylesheet will be used and + * the "raw" XML of the sitemap index will be displayed. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @param string $sitemap_url Full URL for the sitemaps index XSL file. + */ apply_filters_deprecated( 'wp_sitemaps_stylesheet_index_url', array( '' ), '7.2.0' ); return ''; diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 687ae6e5b38d6..6547767676332 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -7,12 +7,14 @@ * @package WordPress * @subpackage Sitemaps * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. */ /** * Stylesheet provider class. * * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. */ #[AllowDynamicProperties] class WP_Sitemaps_Stylesheet { @@ -26,13 +28,8 @@ class WP_Sitemaps_Stylesheet { * @return never */ public function render_stylesheet( $type ) { - wp_die( - sprintf( - __( 'Function %1$s is deprecated since version %2$s with no alternative available.' ), - __METHOD__, - '7.2.0' - ) - ); + _deprecated_function( __METHOD__, '7.2.0' ); + exit; } /** @@ -44,6 +41,7 @@ public function render_stylesheet( $type ) { * @return string Empty string. */ public function get_sitemap_stylesheet() { + _deprecated_function( __METHOD__, '7.2.0' ); return ''; } @@ -56,6 +54,7 @@ public function get_sitemap_stylesheet() { * @return string Empty string. */ public function get_sitemap_index_stylesheet() { + _deprecated_function( __METHOD__, '7.2.0' ); return ''; } @@ -68,6 +67,16 @@ public function get_sitemap_index_stylesheet() { * @return string Empty string. */ public function get_stylesheet_css() { + _deprecated_function( __METHOD__, '7.2.0' ); + + /** + * Filters the CSS only for the sitemap stylesheet. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @param string $css CSS to be applied to default XSL file. + */ apply_filters_deprecated( 'wp_sitemaps_stylesheet_css', array( '' ), '7.2.0' ); return ''; From f2cf82d987a5cff908cd5a77d8b99cbffcf1ac96 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Oct 2026 08:29:10 +0000 Subject: [PATCH 08/22] update patch and stylesheet routes --- src/wp-includes/class-wp.php | 2 +- .../sitemaps/class-wp-sitemaps-renderer.php | 23 +++++++++++++ .../sitemaps/class-wp-sitemaps.php | 32 ++++--------------- tests/phpunit/tests/query/isSitemap.php | 14 -------- tests/phpunit/tests/sitemaps/sitemaps.php | 25 --------------- tests/phpunit/tests/wp/handle404.php | 32 ++++++------------- 6 files changed, 39 insertions(+), 89 deletions(-) diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 67201d1394e91..1cfa0df8f66b3 100644 --- a/src/wp-includes/class-wp.php +++ b/src/wp-includes/class-wp.php @@ -748,7 +748,7 @@ public function handle_404() { // Never 404 here for the admin, robots, favicon, or sitemaps. // Sitemap routes send their own status in WP_Sitemaps::render_sitemaps(). - if ( is_admin() || is_robots() || is_favicon() || is_sitemap() || get_query_var( 'sitemap-stylesheet' ) ) { + if ( is_admin() || is_robots() || is_favicon() || is_sitemap() ) { $set_404 = false; // If posts were found, check for paged content. diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 5e86a07bd4051..9bbf4facd0494 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -16,6 +16,29 @@ */ #[AllowDynamicProperties] class WP_Sitemaps_Renderer { + /** + * Sitemap stylesheet URL. + * + * @deprecated 7.2.0 Stylesheets are no longer supported. + * @var string + */ + protected $stylesheet = ''; + + /** + * Sitemap index stylesheet URL. + * + * @deprecated 7.2.0 Stylesheets are no longer supported. + * @var string + */ + protected $stylesheet_index = ''; + + /** + * Constructor retained for backward compatibility. + * + * @deprecated 7.2.0 Stylesheets are no longer supported. + */ + public function __construct() {} + /** * Gets the URL for the sitemap stylesheet. * diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps.php b/src/wp-includes/sitemaps/class-wp-sitemaps.php index 87b3765b3f2e3..980c40642b219 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps.php @@ -135,11 +135,6 @@ public function register_rewrites() { // Register index route. add_rewrite_rule( '^wp-sitemap\.xml$', 'index.php?sitemap=index', 'top' ); - // Register rewrites for the XSL stylesheet. - add_rewrite_tag( '%sitemap-stylesheet%', '([^?]+)' ); - add_rewrite_rule( '^wp-sitemap\.xsl$', 'index.php?sitemap-stylesheet=sitemap', 'top' ); - add_rewrite_rule( '^wp-sitemap-index\.xsl$', 'index.php?sitemap-stylesheet=index', 'top' ); - // Register routes for providers. add_rewrite_rule( '^wp-sitemap-([a-z]+?)-([a-z\d_-]+?)-(\d+?)\.xml$', @@ -160,7 +155,7 @@ public function register_rewrites() { */ public function render_sitemaps() { /* - * Bail early if this isn't a sitemap or stylesheet route. + * Bail early if this isn't a sitemap route. * * This runs on every front-end request, so it comes before any * sanitizing. The raw query vars are tested here, matching @@ -168,17 +163,16 @@ public function render_sitemaps() { * the same basis. Testing the sanitized values instead would let a * request that handle_404() exempted fall through both, leaving it a 200. */ - if ( ! get_query_var( 'sitemap' ) && ! get_query_var( 'sitemap-stylesheet' ) ) { + if ( ! get_query_var( 'sitemap' ) ) { return; } - $sitemap = sanitize_text_field( get_query_var( 'sitemap' ) ); - $object_subtype = sanitize_text_field( get_query_var( 'sitemap-subtype' ) ); - $stylesheet_type = sanitize_text_field( get_query_var( 'sitemap-stylesheet' ) ); - $paged = absint( get_query_var( 'paged' ) ); + $sitemap = sanitize_text_field( get_query_var( 'sitemap' ) ); + $object_subtype = sanitize_text_field( get_query_var( 'sitemap-subtype' ) ); + $paged = absint( get_query_var( 'paged' ) ); // Force a 404 and bail early if the route did not survive sanitizing. - if ( ! ( $sitemap || $stylesheet_type ) ) { + if ( ! $sitemap ) { $this->send_404(); return; } @@ -188,20 +182,6 @@ public function render_sitemaps() { return; } - // Render stylesheet if this is stylesheet route. - if ( $stylesheet_type ) { - // Force a 404 and bail early if the stylesheet type is not recognized. - if ( ! in_array( $stylesheet_type, array( 'sitemap', 'index' ), true ) ) { - $this->send_404(); - return; - } - - $stylesheet = new WP_Sitemaps_Stylesheet(); - - $stylesheet->render_stylesheet( $stylesheet_type ); - exit; - } - // Render the index. if ( 'index' === $sitemap ) { $sitemap_list = $this->index->get_sitemap_list(); diff --git a/tests/phpunit/tests/query/isSitemap.php b/tests/phpunit/tests/query/isSitemap.php index f772ed09d26e5..5430db0c0d47f 100644 --- a/tests/phpunit/tests/query/isSitemap.php +++ b/tests/phpunit/tests/query/isSitemap.php @@ -109,20 +109,6 @@ public function test_is_sitemap_false_for_empty_sitemap_var(): void { $this->assertFalse( $query->is_sitemap(), 'An empty "sitemap" query var should not set is_sitemap.' ); } - /** - * The sitemap stylesheet route uses the "sitemap-stylesheet" query var, which must - * not flag the query as a sitemap. - * - * @ticket 51543 - * - * @covers WP_Query::parse_query - */ - public function test_is_sitemap_false_for_stylesheet_route(): void { - $query = new WP_Query( array( 'sitemap-stylesheet' => 'sitemap' ) ); - - $this->assertFalse( $query->is_sitemap(), 'The sitemap stylesheet route should not flag the query as a sitemap.' ); - } - /** * is_robots takes precedence over is_sitemap in the parse_query branch. * diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php index 3a0d3adc4e675..a4062e887123c 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps.php +++ b/tests/phpunit/tests/sitemaps/sitemaps.php @@ -548,34 +548,9 @@ public function data_unusable_sitemap_query_vars(): array { return array( 'value stripped by sanitizing' => array( '?sitemap=<>' ), 'array sitemap value' => array( '?sitemap[]=index' ), - 'array stylesheet value' => array( '?sitemap-stylesheet[]=sitemap' ), ); } - /** - * Ensures an unrecognized stylesheet type 404s from render_sitemaps(). - * - * WP::handle_404() exempts any request carrying a `sitemap-stylesheet` - * query var, and WP_Sitemaps_Stylesheet::render_stylesheet() echoes nothing - * for a type other than 'sitemap' or 'index', so this route would otherwise - * be served as a 200 with an empty body. - * - * @ticket 65945 - */ - public function test_unrecognized_stylesheet_type_should_return_404() { - // Instantiate the server before navigating: registering the sitemap rewrite - // tags is what adds `sitemap-stylesheet` to `$wp->public_query_vars`. - $sitemaps = wp_sitemaps_get_server(); - - $this->go_to( home_url( '/?sitemap-stylesheet=this-is-not-a-stylesheet' ) ); - - $this->assertFalse( is_404(), 'WP::handle_404() should not have set a 404.' ); - - $sitemaps->render_sitemaps(); - - $this->assertTrue( is_404(), 'render_sitemaps() should have set a 404.' ); - } - /** * Ensures an unregistered provider 404s from render_sitemaps(). * diff --git a/tests/phpunit/tests/wp/handle404.php b/tests/phpunit/tests/wp/handle404.php index 4b6b55064367e..e43af4da01d04 100644 --- a/tests/phpunit/tests/wp/handle404.php +++ b/tests/phpunit/tests/wp/handle404.php @@ -59,34 +59,20 @@ public function data_sitemap_requests(): array { } /** - * The sitemap stylesheet routes must not be 404ed either. - * - * Covered separately because is_sitemap() only reflects the `sitemap` query var. + * A legacy sitemap stylesheet query var must not bypass 404 handling. * * @ticket 65945 - * - * @dataProvider data_sitemap_stylesheet_requests - * - * @param non-falsy-string $url Stylesheet URL to request. */ - public function test_sitemap_stylesheet_requests_should_not_be_404ed_by_an_empty_main_query( string $url ) { - $this->go_to( home_url( $url ) ); + public function test_legacy_sitemap_stylesheet_query_var_does_not_bypass_404() { + global $wp; - $this->assertFalse( is_404(), 'WP::handle_404() should not have set a 404.' ); - } + $public_query_vars = $wp->public_query_vars; + $wp->add_query_var( 'sitemap-stylesheet' ); - /** - * Data provider. - * - * @return array - */ - public function data_sitemap_stylesheet_requests(): array { - return array( - 'sitemap stylesheet' => array( '/?sitemap-stylesheet=sitemap' ), - 'index stylesheet' => array( '/?sitemap-stylesheet=index' ), - // Not a real route, but the only stylesheet case is_home() doesn't already cover. - 'sitemap stylesheet, paged' => array( '/?sitemap-stylesheet=sitemap&paged=2' ), - ); + $this->go_to( home_url( '/this-page-does-not-exist/?sitemap-stylesheet=sitemap' ) ); + $wp->public_query_vars = $public_query_vars; + + $this->assertTrue( is_404(), 'A legacy sitemap stylesheet query var should not bypass 404 handling.' ); } /** From bb3fd50af681068ddf6d4f68d976bb1f9f65c358 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Oct 2026 09:10:13 +0000 Subject: [PATCH 09/22] rework tests --- .../phpunit/tests/sitemaps/wpSitemapsRenderer.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index 013ed1c4b5853..ffc73f5c1c9eb 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -192,9 +192,9 @@ public function test_get_sitemap_xml_extra_elements() { } /** - * Test that the sitemap stylesheet URL can be filtered. + * Test that the sitemap stylesheet URL filter cannot add a stylesheet. * - * @covers WP_Sitemaps_Renderer::get_sitemap_stylesheet_url + * @covers WP_Sitemaps_Renderer::get_sitemap_xml */ public function test_get_sitemap_stylesheet_url_filter() { $custom_url = 'https://example.com/custom-sitemap.xsl'; @@ -214,13 +214,13 @@ static function () use ( $custom_url ) { ); $actual = $sitemap_renderer->get_sitemap_xml( $entries ); - $this->assertStringContainsString( '', $actual ); + $this->assertStringNotContainsString( 'get_sitemap_index_xml( $entries ); - $this->assertStringContainsString( '', $actual ); + $this->assertStringNotContainsString( 'get_sitemap_xml( array() ); $expected = '' . - '' . ''; $this->assertXMLEquals( $expected, $actual, 'Empty sitemap markup incorrect.' ); @@ -267,7 +266,6 @@ public function test_get_sitemap_index_xml_empty() { $renderer = new WP_Sitemaps_Renderer(); $actual = $renderer->get_sitemap_index_xml( array() ); $expected = '' . - '' . ''; $this->assertXMLEquals( $expected, $actual, 'Empty sitemap index markup incorrect.' ); @@ -298,7 +296,6 @@ public function test_get_sitemap_xml_with_all_supported_fields() { $actual = $renderer->get_sitemap_xml( $url_list ); $expected = '' . - '' . '' . '' . 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1' . From ee2d87e800a281c4b1fcec3be0e697a59540250a Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:23:25 -0700 Subject: [PATCH 10/22] Regenerate PHPStan baselines --- tests/phpstan/baselines/deadCode.unreachable.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/phpstan/baselines/deadCode.unreachable.neon b/tests/phpstan/baselines/deadCode.unreachable.neon index 8a4288bc40c43..2282799c3903d 100644 --- a/tests/phpstan/baselines/deadCode.unreachable.neon +++ b/tests/phpstan/baselines/deadCode.unreachable.neon @@ -63,8 +63,3 @@ parameters: identifier: deadCode.unreachable count: 1 path: ../../../src/wp-includes/pluggable.php - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 1 - path: ../../../src/wp-includes/sitemaps/class-wp-sitemaps.php From 32e72e3db9762b6fc8781976aab6c9f706cc4702 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:25:03 -0700 Subject: [PATCH 11/22] Send 410 Gone status code when calling render_stylesheet() --- src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 4d9f37108b052..083824eeba11b 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -30,6 +30,7 @@ class WP_Sitemaps_Stylesheet { * @return never */ public function render_stylesheet( $type ) { + status_header( 410 ); _deprecated_function( __METHOD__, '7.2.0' ); exit; } From 4455d16ccd371755749125f104e691663b072e38 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:25:54 -0700 Subject: [PATCH 12/22] Unset unused param --- src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 083824eeba11b..b8bbb35731f42 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -30,6 +30,7 @@ class WP_Sitemaps_Stylesheet { * @return never */ public function render_stylesheet( $type ) { + unset( $type ); status_header( 410 ); _deprecated_function( __METHOD__, '7.2.0' ); exit; From 3c49b020bea56122f8635c87673b3bfd1df38626 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:39:40 -0700 Subject: [PATCH 13/22] Remove duplicate @since tag from render_stylesheet() docblock Co-Authored-By: Claude Opus 5.5 --- src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index b8bbb35731f42..d8221a7cad793 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -24,8 +24,6 @@ class WP_Sitemaps_Stylesheet { * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. * - * @since 5.5.0 - * * @param string $type Stylesheet type. Either 'sitemap' or 'index'. * @return never */ From 8fee4bea0d8842d2857543ef7be8fbb1dc288a49 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:43:59 -0700 Subject: [PATCH 14/22] Trigger deprecation notices for removed sitemap stylesheet filters The stylesheet filters were only applied in methods that core no longer calls, and the two stylesheet content filters were not applied at all, so a plugin's callback on any of them was silently ignored. Apply all five where the sitemap and sitemap index XML is generated, so that a callback triggers a deprecation notice. A filter with no callbacks triggers nothing. Co-Authored-By: Claude Opus 5.5 --- .../sitemaps/class-wp-sitemaps-renderer.php | 48 +++++++++++++ .../tests/sitemaps/wpSitemapsRenderer.php | 68 +++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 9bbf4facd0494..e0bee85978f46 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -118,6 +118,8 @@ public function render_index( $sitemaps ) { * @return string|false A well-formed XML string for a sitemap index. False on error. */ public function get_sitemap_index_xml( $sitemaps ) { + $this->apply_deprecated_stylesheet_filters( 'index' ); + $sitemap_index = new SimpleXMLElement( sprintf( '%1$s%2$s', @@ -181,6 +183,8 @@ public function render_sitemap( $url_list ) { * @return string|false A well-formed XML string for a sitemap index. False on error. */ public function get_sitemap_xml( $url_list ) { + $this->apply_deprecated_stylesheet_filters( 'sitemap' ); + $urlset = new SimpleXMLElement( sprintf( '%1$s%2$s', @@ -215,6 +219,50 @@ public function get_sitemap_xml( $url_list ) { return $urlset->asXML(); } + /** + * Applies the removed stylesheet filters so that their callbacks trigger deprecation notices. + * + * The stylesheet filters no longer have any effect. Applying them where a sitemap is + * generated ensures a callback still added to one is reported rather than silently ignored. + * No notice is triggered for a filter that has no callbacks. + * + * @since 7.2.0 + * + * @param string $type Sitemap type. Either 'sitemap' or 'index'. + */ + private function apply_deprecated_stylesheet_filters( string $type ): void { + if ( 'index' === $type ) { + /** This filter is documented in wp-includes/sitemaps/class-wp-sitemaps-renderer.php */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_index_url', array( '' ), '7.2.0' ); + + /** + * Filters the content of the sitemap index stylesheet. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @param string $xsl_content Full content for the XML stylesheet. + */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_index_content', array( '' ), '7.2.0' ); + } else { + /** This filter is documented in wp-includes/sitemaps/class-wp-sitemaps-renderer.php */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_url', array( '' ), '7.2.0' ); + + /** + * Filters the content of the sitemap stylesheet. + * + * @since 5.5.0 + * @deprecated 7.2.0 Stylesheets are no longer supported. + * + * @param string $xsl_content Full content for the XML stylesheet. + */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_content', array( '' ), '7.2.0' ); + } + + /** This filter is documented in wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php */ + apply_filters_deprecated( 'wp_sitemaps_stylesheet_css', array( '' ), '7.2.0' ); + } + /** * Checks for the availability of the SimpleXML extension and errors if missing. * diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index ffc73f5c1c9eb..06601612f53b8 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -197,6 +197,8 @@ public function test_get_sitemap_xml_extra_elements() { * @covers WP_Sitemaps_Renderer::get_sitemap_xml */ public function test_get_sitemap_stylesheet_url_filter() { + $this->setExpectedDeprecated( 'wp_sitemaps_stylesheet_url' ); + $custom_url = 'https://example.com/custom-sitemap.xsl'; add_filter( @@ -223,6 +225,8 @@ static function () use ( $custom_url ) { * @covers WP_Sitemaps_Renderer::get_sitemap_index_xml */ public function test_get_sitemap_index_stylesheet_url_filter() { + $this->setExpectedDeprecated( 'wp_sitemaps_stylesheet_index_url' ); + $custom_url = 'https://example.com/custom-sitemap-index.xsl'; add_filter( @@ -243,6 +247,70 @@ static function () use ( $custom_url ) { $this->assertStringNotContainsString( 'setExpectedDeprecated( $hook_name ); + + add_filter( $hook_name, '__return_empty_string' ); + + $sitemap_renderer = new WP_Sitemaps_Renderer(); + $entries = array( + array( + 'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1', + ), + ); + + $actual = $sitemap_renderer->$method( $entries ); + $this->assertIsString( $actual ); + $this->assertStringNotContainsString( ' + */ + public function data_deprecated_stylesheet_filters(): array { + return array( + 'stylesheet URL' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_url', + 'method' => 'get_sitemap_xml', + ), + 'stylesheet content' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_content', + 'method' => 'get_sitemap_xml', + ), + 'stylesheet CSS for sitemap' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_css', + 'method' => 'get_sitemap_xml', + ), + 'index stylesheet URL' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_index_url', + 'method' => 'get_sitemap_index_xml', + ), + 'index stylesheet content' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_index_content', + 'method' => 'get_sitemap_index_xml', + ), + 'stylesheet CSS for index' => array( + 'hook_name' => 'wp_sitemaps_stylesheet_css', + 'method' => 'get_sitemap_index_xml', + ), + ); + } + /** * Test XML output for empty sitemap page renderer. * From 69a133243b55624f5e36a27126dd9355bc901da5 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:49:35 -0700 Subject: [PATCH 15/22] Mark sitemap stylesheet URL methods as deprecated at runtime Call _deprecated_function() in WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() and get_sitemap_index_stylesheet_url(), matching the deprecated methods of WP_Sitemaps_Stylesheet. Previously a direct call only triggered a notice if a callback was added to the method's filter. Co-Authored-By: Claude Opus 5.5 --- .../sitemaps/class-wp-sitemaps-renderer.php | 4 ++++ .../tests/sitemaps/wpSitemapsRenderer.php | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index e0bee85978f46..4a1e6cdfedc73 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -48,6 +48,8 @@ public function __construct() {} * @return string Empty string. */ public function get_sitemap_stylesheet_url() { + _deprecated_function( __METHOD__, '7.2.0' ); + /** * Filters the URL for the sitemap stylesheet. * @@ -73,6 +75,8 @@ public function get_sitemap_stylesheet_url() { * @return string Empty string. */ public function get_sitemap_index_stylesheet_url() { + _deprecated_function( __METHOD__, '7.2.0' ); + /** * Filters the URL for the sitemap index stylesheet. * diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index 06601612f53b8..31c3cb6bb7aef 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -277,6 +277,24 @@ public function test_deprecated_stylesheet_filters( string $hook_name, string $m $this->assertStringNotContainsString( 'assertSame( '', $sitemap_renderer->get_sitemap_stylesheet_url(), 'The sitemap stylesheet URL should be empty.' ); + $this->assertSame( '', $sitemap_renderer->get_sitemap_index_stylesheet_url(), 'The sitemap index stylesheet URL should be empty.' ); + } + /** * Data provider for {@see self::test_deprecated_stylesheet_filters()}. * From 4c3ac9ef56019a90ec79788f1f2a09c4434adee4 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:50:14 -0700 Subject: [PATCH 16/22] Restore @since tags on deprecated sitemap renderer members The $stylesheet and $stylesheet_index properties and the constructor of WP_Sitemaps_Renderer had their original @since 5.5.0 tags replaced by @deprecated. Keep both, as is done for the deprecated methods. Co-Authored-By: Claude Opus 5.5 --- src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 4a1e6cdfedc73..2fea6e400bff7 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -19,7 +19,9 @@ class WP_Sitemaps_Renderer { /** * Sitemap stylesheet URL. * + * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. + * * @var string */ protected $stylesheet = ''; @@ -27,7 +29,9 @@ class WP_Sitemaps_Renderer { /** * Sitemap index stylesheet URL. * + * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. + * * @var string */ protected $stylesheet_index = ''; @@ -35,6 +39,7 @@ class WP_Sitemaps_Renderer { /** * Constructor retained for backward compatibility. * + * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. */ public function __construct() {} From 43f62af41bf22ffe9c30cecfc80c7f4dded18cda Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:53:29 -0700 Subject: [PATCH 17/22] Remove @deprecated tag from WP_Sitemaps_Renderer constructor Only the constructor's body was removed, not the class, and core still instantiates WP_Sitemaps_Renderer. Tagging the constructor as deprecated would cause IDEs and static analysis to flag every instantiation. Document the change with a @since 7.2.0 note instead. Co-Authored-By: Claude Opus 5.5 --- src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 2fea6e400bff7..def767ec3262b 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -37,10 +37,10 @@ class WP_Sitemaps_Renderer { protected $stylesheet_index = ''; /** - * Constructor retained for backward compatibility. + * WP_Sitemaps_Renderer constructor. * * @since 5.5.0 - * @deprecated 7.2.0 Stylesheets are no longer supported. + * @since 7.2.0 No longer sets up the stylesheets, which are no longer supported. */ public function __construct() {} From 33a93345bfe50459439a7333df03fec3a3cab359 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 16:55:19 -0700 Subject: [PATCH 18/22] Add tests for deprecated WP_Sitemaps_Stylesheet methods Cover get_sitemap_stylesheet(), get_sitemap_index_stylesheet() and get_stylesheet_css(), each of which must return an empty string and trigger a deprecation notice. The previous tests for this class were removed along with the stylesheet content filters they exercised. Co-Authored-By: Claude Opus 5.5 --- .../tests/sitemaps/wpSitemapsStylesheet.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php new file mode 100644 index 0000000000000..663180cce0aa9 --- /dev/null +++ b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php @@ -0,0 +1,39 @@ +setExpectedDeprecated( "WP_Sitemaps_Stylesheet::$method" ); + + $stylesheet = new WP_Sitemaps_Stylesheet(); + + $this->assertSame( '', $stylesheet->$method() ); + } + + /** + * Data provider for {@see self::test_deprecated_methods()}. + * + * @return array + */ + public function data_deprecated_methods(): array { + return array( + 'sitemap stylesheet' => array( 'method' => 'get_sitemap_stylesheet' ), + 'index stylesheet' => array( 'method' => 'get_sitemap_index_stylesheet' ), + 'stylesheet CSS' => array( 'method' => 'get_stylesheet_css' ), + ); + } +} From e69134704f0234df266956d3e31c67d029900933 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 17:00:09 -0700 Subject: [PATCH 19/22] Restore original descriptions of deprecated sitemap renderer properties The $stylesheet and $stylesheet_index properties are deprecated, not repurposed, so keep their original descriptions and only add @deprecated. Co-Authored-By: Claude Opus 5.5 --- src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index def767ec3262b..d6b7b85467a46 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -17,7 +17,7 @@ #[AllowDynamicProperties] class WP_Sitemaps_Renderer { /** - * Sitemap stylesheet URL. + * XSL stylesheet for styling a sitemap for web browsers. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -27,7 +27,7 @@ class WP_Sitemaps_Renderer { protected $stylesheet = ''; /** - * Sitemap index stylesheet URL. + * XSL stylesheet for styling a sitemap for web browsers. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. From 6839dd542a80dba605786a833df5c996b028a21e Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 17:02:18 -0700 Subject: [PATCH 20/22] Use string literal enum for sitemap type --- src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index d6b7b85467a46..9850c7428d915 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -237,7 +237,7 @@ public function get_sitemap_xml( $url_list ) { * * @since 7.2.0 * - * @param string $type Sitemap type. Either 'sitemap' or 'index'. + * @param 'sitemap'|'index' $type Sitemap type. */ private function apply_deprecated_stylesheet_filters( string $type ): void { if ( 'index' === $type ) { From 82cba66c51c1364e589edfd0b0efe951d39eb7b2 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 2 Oct 2026 17:03:51 -0700 Subject: [PATCH 21/22] Restore original descriptions of deprecated sitemap stylesheet methods The methods of WP_Sitemaps_Stylesheet are deprecated, not repurposed, so keep their original descriptions alongside the @deprecated tags. Co-Authored-By: Claude Opus 5.5 --- src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index d8221a7cad793..635753cd04bdc 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -19,7 +19,7 @@ #[AllowDynamicProperties] class WP_Sitemaps_Stylesheet { /** - * Renders the XSL stylesheet. + * Renders the XSL stylesheet depending on whether it's the sitemap index or not. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -35,7 +35,7 @@ public function render_stylesheet( $type ) { } /** - * Returns the stylesheet for all sitemaps, except index. + * Returns the escaped XSL for all sitemaps, except index. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -48,7 +48,7 @@ public function get_sitemap_stylesheet() { } /** - * Returns the stylesheet for the sitemap index. + * Returns the escaped XSL for the index sitemaps. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -61,7 +61,7 @@ public function get_sitemap_index_stylesheet() { } /** - * Returns the stylesheet CSS. + * Gets the CSS to be included in sitemap XSL stylesheets. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. From 5252775b92c8ffa929621d9cc4c41bf36dd6d570 Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Sat, 3 Oct 2026 11:10:35 +1000 Subject: [PATCH 22/22] Note filter outcomes ignored. Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> --- .../sitemaps/class-wp-sitemaps-renderer.php | 12 ++++++++++-- .../sitemaps/class-wp-sitemaps-stylesheet.php | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 9850c7428d915..b1ae1db5cc6dd 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -59,7 +59,8 @@ public function get_sitemap_stylesheet_url() { * Filters the URL for the sitemap stylesheet. * * If a falsey value is returned, no stylesheet will be used and - * the "raw" XML of the sitemap will be displayed. + * Following the deprecation of XSLT by browser manufacturers the + * outcome of this filter is ignored. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -86,7 +87,8 @@ public function get_sitemap_index_stylesheet_url() { * Filters the URL for the sitemap index stylesheet. * * If a falsey value is returned, no stylesheet will be used and - * the "raw" XML of the sitemap index will be displayed. + * Following the deprecation of XSLT by browser manufacturers the + * outcome of this filter is ignored. * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. @@ -247,6 +249,9 @@ private function apply_deprecated_stylesheet_filters( string $type ): void { /** * Filters the content of the sitemap index stylesheet. * + * Following the deprecation of XSLT by browser manufacturers the + * outcome of this filter is ignored. + * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. * @@ -260,6 +265,9 @@ private function apply_deprecated_stylesheet_filters( string $type ): void { /** * Filters the content of the sitemap stylesheet. * + * Following the deprecation of XSLT by browser manufacturers the + * outcome of this filter is ignored. + * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. * diff --git a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 635753cd04bdc..6e5b6d1526cc4 100644 --- a/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -74,6 +74,9 @@ public function get_stylesheet_css() { /** * Filters the CSS only for the sitemap stylesheet. * + * Following the deprecation of XSLT by browser manufacturers the + * outcome of this filter is ignored. + * * @since 5.5.0 * @deprecated 7.2.0 Stylesheets are no longer supported. *