WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() WordPress Method
The WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() method is used to get the URL for the sitemap stylesheet.
WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() #
Gets the URL for the sitemap stylesheet.
Return
(string) The sitemap stylesheet URL.
Source
File: wp-includes/sitemaps/class-wp-sitemaps-renderer.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 ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |