Renders the XSL stylesheet depending on whether it’s the sitemap index or not.
$typestringrequired
'sitemap' or 'index'.public function render_stylesheet( $type ) {
header( 'Content-Type: application/xml; charset=UTF-8' );
if ( 'sitemap' === $type ) {
// All content is escaped below.
echo $this->get_sitemap_stylesheet();
}
if ( 'index' === $type ) {
// All content is escaped below.
echo $this->get_sitemap_index_stylesheet();
}
exit;
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps_stylesheet/render_stylesheet