WP_Sitemaps_Stylesheet::render_stylesheet( string $type )

In this article

Renders the XSL stylesheet depending on whether it’s the sitemap index or not.

Parameters

$typestringrequired
Stylesheet type. Either 'sitemap' or 'index'.

Source

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;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.