WP_Sitemaps_Stylesheet::render_stylesheet() public WP 1.0
Renders the XSL stylesheet depending on whether it's the sitemap index or not.
{} It's a method of the class: WP_Sitemaps_Stylesheet{}
No Hooks.
Return
Null. Nothing.
Usage
$WP_Sitemaps_Stylesheet = new WP_Sitemaps_Stylesheet(); $WP_Sitemaps_Stylesheet->render_stylesheet( $type );
- $type(string) (required)
- Stylesheet type. Either 'sitemap' or 'index'.
Code of WP_Sitemaps_Stylesheet::render_stylesheet() WP Sitemaps Stylesheet::render stylesheet WP 5.6
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;
}