WordPress at a glance
function is not described

WP_Sitemaps_Renderer::render_sitemap() public WP 5.5.0

Renders a sitemap.

{} It's a method of the class: WP_Sitemaps_Renderer{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_Sitemaps_Renderer = new WP_Sitemaps_Renderer();
$WP_Sitemaps_Renderer->render_sitemap( $url_list );
$url_list(array) (required)
Array of URLs for a sitemap.

Changelog

Since 5.5.0 Introduced.

Code of WP_Sitemaps_Renderer::render_sitemap() WP 5.5.1

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