WP_Sitemaps_Renderer::render_index() WordPress Method

The WP_Sitemaps_Renderer::render_index() method is used to render the sitemap index for a given sitemap. This index is used to provide an overview of the sitemap, and can be used to navigate to the different parts of the sitemap.

WP_Sitemaps_Renderer::render_index( array $sitemaps ) #

Renders a sitemap index.


Parameters

$sitemaps

(array)(Required)Array of sitemap URLs.


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.