Renders a sitemap.
$url_listarrayrequired
public function render_sitemap( $url_list ) {
header( 'Content-Type: application/xml; charset=UTF-8' );
$this->check_for_simple_xml_availability();
$sitemap_xml = $this->get_sitemap_xml( $url_list );
if ( ! empty( $sitemap_xml ) ) {
// All output is escaped within get_sitemap_xml().
echo $sitemap_xml;
}
}
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps_renderer/render_sitemap