WordPress at a glance
function is not described

WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() public WP 5.5.0

Gets the URL for the sitemap stylesheet.

It's a method of the class: WP_Sitemaps_Renderer{}

Hooks from the method
Return

String. The sitemap stylesheet URL.

Usage

$WP_Sitemaps_Renderer = new WP_Sitemaps_Renderer();
$WP_Sitemaps_Renderer->get_sitemap_stylesheet_url();

Notes

  • Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.

Changelog

Since 5.5.0 Introduced.

Code of WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() WP 5.5.1

<?php
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 );
}