Commit 86eb98309f for wordpress.org

commit 86eb98309fb4a3a3644eaff465afed678936ba19
Author: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Date:   Sat Oct 3 01:46:49 2026 +0000

    Sitemaps: Remove XSL stylesheets.

    Browser support for client-side XSLT is being deprecated and removed. For sites including an XSL stylesheet, the display of the XML sitemaps may fail.

    This removes the stylesheets in favour of allowing browsers to render them as they will.

    This change deprecates:

    * `WP_Sitemaps_Renderer::$stylesheet`
    * `WP_Sitemaps_Renderer::$stylesheet_index`
    * `WP_Sitemaps_Renderer::get_sitemap_stylesheet_url()`
    * `WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url()`
    * `WP_Sitemaps_Stylesheet` in its entirety
    * the `sitemap-stylesheet` rewrite tag
    * the `sitemap-stylesheet` query variable
    * the `*.xls` rewrite rules
    * the `wp_sitemaps_stylesheet_url` filter
    * the `wp_sitemaps_stylesheet_index_url` filter
    * the `wp_sitemaps_stylesheet_index_content` filter
    * the `wp_sitemaps_stylesheet_content` filter
    * the `wp_sitemaps_stylesheet_css` filter

    The outcome of the deprecated filters is ignored, the filters are now only fired in order to provide deprecation notices to developers.

    Developed in https://github.com/WordPress/wordpress-develop/pull/12448

    Props masteradhoc, pbiron, westonruter, peterwilsoncc.
    Fixes #65593.

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


    git-svn-id: http://core.svn.wordpress.org/trunk@63232 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php
index 2b7553bda5..c284fe41fa 100644
--- a/wp-includes/canonical.php
+++ b/wp-includes/canonical.php
@@ -707,9 +707,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/wp-includes/class-wp.php b/wp-includes/class-wp.php
index 67201d1394..1cfa0df8f6 100644
--- a/wp-includes/class-wp.php
+++ b/wp-includes/class-wp.php
@@ -748,7 +748,7 @@ class WP {

 		// 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/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php
index 10a1ef1e7f..b1ae1db5cc 100644
--- a/wp-includes/sitemaps/class-wp-sitemaps-renderer.php
+++ b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php
@@ -20,6 +20,7 @@ class WP_Sitemaps_Renderer {
 	 * XSL stylesheet for styling a sitemap for web browsers.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
 	 *
 	 * @var string
 	 */
@@ -29,6 +30,7 @@ class WP_Sitemaps_Renderer {
 	 * XSL stylesheet for styling a sitemap for web browsers.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
 	 *
 	 * @var string
 	 */
@@ -38,81 +40,64 @@ class WP_Sitemaps_Renderer {
 	 * WP_Sitemaps_Renderer constructor.
 	 *
 	 * @since 5.5.0
+	 * @since 7.2.0 No longer sets up the stylesheets, which are no longer supported.
 	 */
-	public function __construct() {
-		$stylesheet_url = $this->get_sitemap_stylesheet_url();
-
-		if ( $stylesheet_url ) {
-			$this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_url ) . '" ?>';
-		}
-
-		$stylesheet_index_url = $this->get_sitemap_index_stylesheet_url();
-
-		if ( $stylesheet_index_url ) {
-			$this->stylesheet_index = '<?xml-stylesheet type="text/xsl" href="' . esc_url( $stylesheet_index_url ) . '" ?>';
-		}
-	}
+	public function __construct() {}

 	/**
 	 * Gets the URL for the sitemap stylesheet.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
 	 *
-	 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
-	 *
-	 * @return string The sitemap stylesheet URL.
+	 * @return string Empty string.
 	 */
 	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' );
-		}
+		_deprecated_function( __METHOD__, '7.2.0' );

 		/**
 		 * 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.
 		 *
 		 * @param string $sitemap_url Full URL for the sitemaps XSL file.
 		 */
-		return apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url );
+		apply_filters_deprecated( 'wp_sitemaps_stylesheet_url', array( '' ), '7.2.0' );
+
+		return '';
 	}

 	/**
 	 * Gets the URL for the sitemap index stylesheet.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
 	 *
-	 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
-	 *
-	 * @return string The sitemap index stylesheet URL.
+	 * @return string Empty string.
 	 */
 	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' );
-		}
+		_deprecated_function( __METHOD__, '7.2.0' );

 		/**
 		 * 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.
 		 *
 		 * @param string $sitemap_url Full URL for the sitemaps index XSL file.
 		 */
-		return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );
+		apply_filters_deprecated( 'wp_sitemaps_stylesheet_index_url', array( '' ), '7.2.0' );
+
+		return '';
 	}

 	/**
@@ -144,11 +129,12 @@ class WP_Sitemaps_Renderer {
 	 * @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%3$s',
+				'%1$s%2$s',
 				'<?xml version="1.0" encoding="UTF-8" ?>',
-				$this->stylesheet_index,
 				'<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
 			)
 		);
@@ -208,11 +194,12 @@ class WP_Sitemaps_Renderer {
 	 * @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%3$s',
+				'%1$s%2$s',
 				'<?xml version="1.0" encoding="UTF-8" ?>',
-				$this->stylesheet,
 				'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'
 			)
 		);
@@ -243,6 +230,56 @@ class WP_Sitemaps_Renderer {
 		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 'sitemap'|'index' $type Sitemap type.
+	 */
+	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.
+			 *
+			 * 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.
+			 *
+			 * @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.
+			 *
+			 * 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.
+			 *
+			 * @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/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php
index b07fe5d4cf..6e5b6d1526 100644
--- a/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php
+++ b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php
@@ -2,17 +2,19 @@
 /**
  * Sitemaps: WP_Sitemaps_Stylesheet class
  *
- * This class provides the XSL stylesheets to style all sitemaps.
+ * This class is retained for backward compatibility.
  *
  * @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 {
@@ -20,23 +22,15 @@ class WP_Sitemaps_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.
 	 *
 	 * @param string $type Stylesheet type. Either 'sitemap' or 'index'.
 	 * @return never
 	 */
 	public function render_stylesheet( $type ) {
-		header( 'Content-Type: application/xml; charset=UTF-8' );
-
-		if ( 'sitemap' === $type ) {
-			// All content is escaped below.
-			echo $this->get_sitemap_stylesheet();
-		}
-
-		if ( 'index' === $type ) {
-			// All content is escaped below.
-			echo $this->get_sitemap_index_stylesheet();
-		}
-
+		unset( $type );
+		status_header( 410 );
+		_deprecated_function( __METHOD__, '7.2.0' );
 		exit;
 	}

@@ -44,277 +38,52 @@ class WP_Sitemaps_Stylesheet {
 	 * Returns the escaped XSL for all sitemaps, except index.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
+	 *
+	 * @return string Empty string.
 	 */
 	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(
-			'<a href="%s">%s</a>',
-			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.' ) ),
-			'<xsl:value-of select="count( sitemap:urlset/sitemap:url )" />'
-		);
-
-		$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 = <<<XSL
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-		version="1.0"
-		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
-		exclude-result-prefixes="sitemap"
-		>
-
-	<xsl:output method="html" encoding="UTF-8" indent="yes" />
-
-	<!--
-	  Set variables for whether lastmod, changefreq or priority occur for any url in the sitemap.
-	  We do this up front because it can be expensive in a large sitemap.
-	  -->
-	<xsl:variable name="has-lastmod"    select="count( /sitemap:urlset/sitemap:url/sitemap:lastmod )"    />
-	<xsl:variable name="has-changefreq" select="count( /sitemap:urlset/sitemap:url/sitemap:changefreq )" />
-	<xsl:variable name="has-priority"   select="count( /sitemap:urlset/sitemap:url/sitemap:priority )"   />
-
-	<xsl:template match="/">
-		<html {$lang}>
-			<head>
-				<title>{$title}</title>
-				<style>
-					{$css}
-				</style>
-			</head>
-			<body>
-				<div id="sitemap">
-					<div id="sitemap__header">
-						<h1>{$title}</h1>
-						<p>{$description}</p>
-						<p>{$learn_more}</p>
-					</div>
-					<div id="sitemap__content">
-						<p class="text">{$text}</p>
-						<table id="sitemap__table">
-							<thead>
-								<tr>
-									<th class="loc">{$url}</th>
-									<xsl:if test="\$has-lastmod">
-										<th class="lastmod">{$lastmod}</th>
-									</xsl:if>
-									<xsl:if test="\$has-changefreq">
-										<th class="changefreq">{$changefreq}</th>
-									</xsl:if>
-									<xsl:if test="\$has-priority">
-										<th class="priority">{$priority}</th>
-									</xsl:if>
-								</tr>
-							</thead>
-							<tbody>
-								<xsl:for-each select="sitemap:urlset/sitemap:url">
-									<tr>
-										<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
-										<xsl:if test="\$has-lastmod">
-											<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
-										</xsl:if>
-										<xsl:if test="\$has-changefreq">
-											<td class="changefreq"><xsl:value-of select="sitemap:changefreq" /></td>
-										</xsl:if>
-										<xsl:if test="\$has-priority">
-											<td class="priority"><xsl:value-of select="sitemap:priority" /></td>
-										</xsl:if>
-									</tr>
-								</xsl:for-each>
-							</tbody>
-						</table>
-					</div>
-				</div>
-			</body>
-		</html>
-	</xsl:template>
-</xsl:stylesheet>
-
-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 );
+		_deprecated_function( __METHOD__, '7.2.0' );
+		return '';
 	}

 	/**
 	 * Returns the escaped XSL for the index sitemaps.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
+	 *
+	 * @return string Empty string.
 	 */
 	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(
-			'<a href="%s">%s</a>',
-			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.' ) ),
-			'<xsl:value-of select="count( sitemap:sitemapindex/sitemap:sitemap )" />'
-		);
-
-		$lang    = get_language_attributes( 'html' );
-		$url     = esc_xml( __( 'URL' ) );
-		$lastmod = esc_xml( __( 'Last Modified' ) );
-
-		$xsl_content = <<<XSL
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-		version="1.0"
-		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
-		exclude-result-prefixes="sitemap"
-		>
-
-	<xsl:output method="html" encoding="UTF-8" indent="yes" />
-
-	<!--
-	  Set variables for whether lastmod occurs for any sitemap in the index.
-	  We do this up front because it can be expensive in a large sitemap.
-	  -->
-	<xsl:variable name="has-lastmod" select="count( /sitemap:sitemapindex/sitemap:sitemap/sitemap:lastmod )" />
-
-	<xsl:template match="/">
-		<html {$lang}>
-			<head>
-				<title>{$title}</title>
-				<style>
-					{$css}
-				</style>
-			</head>
-			<body>
-				<div id="sitemap">
-					<div id="sitemap__header">
-						<h1>{$title}</h1>
-						<p>{$description}</p>
-						<p>{$learn_more}</p>
-					</div>
-					<div id="sitemap__content">
-						<p class="text">{$text}</p>
-						<table id="sitemap__table">
-							<thead>
-								<tr>
-									<th class="loc">{$url}</th>
-									<xsl:if test="\$has-lastmod">
-										<th class="lastmod">{$lastmod}</th>
-									</xsl:if>
-								</tr>
-							</thead>
-							<tbody>
-								<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
-									<tr>
-										<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
-										<xsl:if test="\$has-lastmod">
-											<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
-										</xsl:if>
-									</tr>
-								</xsl:for-each>
-							</tbody>
-						</table>
-					</div>
-				</div>
-			</body>
-		</html>
-	</xsl:template>
-</xsl:stylesheet>
-
-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 );
+		_deprecated_function( __METHOD__, '7.2.0' );
+		return '';
 	}

 	/**
 	 * Gets the CSS to be included in sitemap XSL stylesheets.
 	 *
 	 * @since 5.5.0
+	 * @deprecated 7.2.0 Stylesheets are no longer supported.
 	 *
-	 * @return string The CSS.
+	 * @return string Empty string.
 	 */
 	public function get_stylesheet_css() {
-		$text_align = is_rtl() ? 'right' : 'left';
-
-		$css = <<<EOF
-
-					body {
-						font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
-						color: #444;
-					}
-
-					#sitemap {
-						max-width: 980px;
-						margin: 0 auto;
-					}
-
-					#sitemap__table {
-						width: 100%;
-						border: solid 1px #ccc;
-						border-collapse: collapse;
-					}
-
-			 		#sitemap__table tr td.loc {
-						/*
-						 * URLs should always be LTR.
-						 * See https://core.trac.wordpress.org/ticket/16834
-						 * and https://core.trac.wordpress.org/ticket/49949
-						 */
-						direction: ltr;
-					}
-
-					#sitemap__table tr th {
-						text-align: {$text_align};
-					}
-
-					#sitemap__table tr td,
-					#sitemap__table tr th {
-						padding: 10px;
-					}
-
-					#sitemap__table tr:nth-child(odd) td {
-						background-color: #eee;
-					}
-
-					a:hover {
-						text-decoration: none;
-					}
-
-EOF;
+		_deprecated_function( __METHOD__, '7.2.0' );

 		/**
 		 * 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.
 		 *
 		 * @param string $css CSS to be applied to default XSL file.
 		 */
-		return apply_filters( 'wp_sitemaps_stylesheet_css', $css );
+		apply_filters_deprecated( 'wp_sitemaps_stylesheet_css', array( '' ), '7.2.0' );
+
+		return '';
 	}
 }
diff --git a/wp-includes/sitemaps/class-wp-sitemaps.php b/wp-includes/sitemaps/class-wp-sitemaps.php
index 87b3765b3f..980c40642b 100644
--- a/wp-includes/sitemaps/class-wp-sitemaps.php
+++ b/wp-includes/sitemaps/class-wp-sitemaps.php
@@ -135,11 +135,6 @@ class WP_Sitemaps {
 		// 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 @@ class WP_Sitemaps {
 	 */
 	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 @@ class WP_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 @@ class WP_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/wp-includes/version.php b/wp-includes/version.php
index 2a150893c9..0947f6b3ce 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-alpha-64072';
+$wp_version = '7.2-alpha-64073';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.