WP_Sitemaps_Stylesheet::render_stylesheet( string $type )

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


Parameters Parameters

$type

(string) (Required) Stylesheet type. Either 'sitemap' or 'index'.


Top ↑

Source Source

File: wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php

	public function render_stylesheet( $type ) {
		header( 'Content-type: application/xml; charset=UTF-8' );

		if ( 'sitemap' === $type ) {
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.
			echo $this->get_sitemap_stylesheet();
		}

		if ( 'index' === $type ) {
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- All content escaped below.
			echo $this->get_sitemap_index_stylesheet();
		}

		exit;
	}


Top ↑

User Contributed Notes User Contributed Notes

Top ↑

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