wp_register_sitemap_provider()WP 5.5.0

Registers a new sitemap provider.

No Hooks.

Return

true|false. Whether the sitemap was added.

Usage

wp_register_sitemap_provider( $name, $provider );
$name(string) (required)
Unique name for the sitemap provider.
$provider(WP_Sitemaps_Provider) (required)
The Sitemaps_Provider instance implementing the sitemap.

Changelog

Since 5.5.0 Introduced.

wp_register_sitemap_provider() code WP 6.1.1

function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) {
	$sitemaps = wp_sitemaps_get_server();

	return $sitemaps->registry->add_provider( $name, $provider );
}