W3cubDocs

/WordPress

WP_Sitemaps_Renderer::render_index( array $sitemaps )

Renders a sitemap index.

Parameters

$sitemaps

(array) (Required) Array of sitemap URLs.

Source

File: wp-includes/sitemaps/class-wp-sitemaps-renderer.php

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().
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			echo $index_xml;
		}
	}

Changelog

Version Description
5.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_sitemaps_renderer/render_index