Filter hook 'wp_sitemaps_stylesheet_content'

in WP Core File wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php at line 151

View Source

wp_sitemaps_stylesheet_content

Filter Hook
Description
Filters the content of the sitemap stylesheet.

Hook Information

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

Hook Parameters

Type Name Description
string $xsl_content Full content for the XML stylesheet.

Usage Examples

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

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

Source Code Context

wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php:151 - How this hook is used in WordPress core
<?php
 146  		 *
 147  		 * @since 5.5.0
 148  		 *
 149  		 * @param string $xsl_content Full content for the XML stylesheet.
 150  		 */
 151  		return apply_filters( 'wp_sitemaps_stylesheet_content', $xsl_content );
 152  	}
 153  
 154  	/**
 155  	 * Returns the escaped XSL for the index sitemaps.
 156  	 *

PHP Documentation

<?php
/**
		 * Filters the content of the sitemap stylesheet.
		 *
		 * @since 5.5.0
		 *
		 * @param string $xsl_content Full content for the XML stylesheet.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php
Related Hooks

Related hooks will be displayed here in future updates.