wp_sitemaps_stylesheet_url
Filter HookDescription
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.Hook Information
File Location |
wp-includes/sitemaps/class-wp-sitemaps-renderer.php
View on GitHub
|
Hook Type | Filter |
Line Number | 84 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$sitemap_url
|
Full URL for the sitemaps XSL file. |
Usage Examples
Basic Usage
<?php
// Hook into wp_sitemaps_stylesheet_url
add_filter('wp_sitemaps_stylesheet_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:84
- How this hook is used in WordPress core
<?php
79 *
80 * @since 5.5.0
81 *
82 * @param string $sitemap_url Full URL for the sitemaps XSL file.
83 */
84 return apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url );
85 }
86
87 /**
88 * Gets the URL for the sitemap index stylesheet.
89 *
PHP Documentation
<?php
/**
* 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.
*/
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.