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.
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; } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |