WP_Sitemaps_Stylesheet::render_stylesheet() public WP 1.0
Renders the XSL stylesheet depending on whether it's the sitemap index or not.
{} Это метод класса: WP_Sitemaps_Stylesheet{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$WP_Sitemaps_Stylesheet = new WP_Sitemaps_Stylesheet(); $WP_Sitemaps_Stylesheet->render_stylesheet( $type );
- $type(строка) (обязательный)
- Stylesheet type. Either 'sitemap' or 'index'.
Код 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;
}