WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url() WordPress Method

The WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url() method is used to get the URL of the stylesheet used for the sitemap index.

WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url() #

Gets the URL for the sitemap index stylesheet.


Return

(string) The sitemap index stylesheet URL.


Top ↑

Source

File: wp-includes/sitemaps/class-wp-sitemaps-renderer.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.