WP_Sitemaps_Stylesheet::render_stylesheet()publicWP 1.0

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

Method of the class: WP_Sitemaps_Stylesheet{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Sitemaps_Stylesheet = new WP_Sitemaps_Stylesheet();
$WP_Sitemaps_Stylesheet->render_stylesheet( $type );
$type(string) (required)
Stylesheet type. Either 'sitemap' or 'index'.

WP_Sitemaps_Stylesheet::render_stylesheet() code WP 6.6.2

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