WP_Sitemaps_Renderer::render_sitemap( array $url_list )

In this article

Renders a sitemap.

Parameters

$url_listarrayrequired
Array of URLs for a sitemap.

Source

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

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

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