wp_register_sitemap_provider( string $name, WP_Sitemaps_Provider $provider ): bool

In this article

Registers a new sitemap provider.

Parameters

$namestringrequired
Unique name for the sitemap provider.
$providerWP_Sitemaps_Providerrequired
The Sitemaps_Provider instance implementing the sitemap.

Return

bool Whether the sitemap was added.

Source

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

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

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.