Filter hook 'wp_sitemaps_stylesheet_index_url'

in WP Core File wp-includes/sitemaps/class-wp-sitemaps-renderer.php at line 115

View Source

wp_sitemaps_stylesheet_index_url

Filter Hook
Description
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.

Hook Information

File Location wp-includes/sitemaps/class-wp-sitemaps-renderer.php View on GitHub
Hook Type Filter
Line Number 115

Hook Parameters

Type Name Description
string $sitemap_url Full URL for the sitemaps index XSL file.

Usage Examples

Basic Usage
<?php
// Hook into wp_sitemaps_stylesheet_index_url
add_filter('wp_sitemaps_stylesheet_index_url', 'my_custom_filter', 10, 1);

function my_custom_filter($sitemap_url) {
    // Your custom filtering logic here
    return $sitemap_url;
}

Source Code Context

wp-includes/sitemaps/class-wp-sitemaps-renderer.php:115 - How this hook is used in WordPress core
<?php
 110  		 *
 111  		 * @since 5.5.0
 112  		 *
 113  		 * @param string $sitemap_url Full URL for the sitemaps index XSL file.
 114  		 */
 115  		return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );
 116  	}
 117  
 118  	/**
 119  	 * Renders a sitemap index.
 120  	 *

PHP Documentation

<?php
/**
		 * 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.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/sitemaps/class-wp-sitemaps-renderer.php
Related Hooks

Related hooks will be displayed here in future updates.