WP_Sitemaps_Renderer::render_index( array $sitemaps )

In this article

Renders a sitemap index.

Parameters

$sitemapsarrayrequired
Array of sitemap URLs.

Source

public function render_index( $sitemaps ) {
	header( 'Content-Type: application/xml; charset=UTF-8' );

	$this->check_for_simple_xml_availability();

	$index_xml = $this->get_sitemap_index_xml( $sitemaps );

	if ( ! empty( $index_xml ) ) {
		// All output is escaped within get_sitemap_index_xml().
		echo $index_xml;
	}
}

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

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