A WordPress-centric search engine for devs and theme authors



wp_register_sitemap ›

Since5.5.0
Deprecatedn/a
wp_register_sitemap ( $name, $provider )
Parameters: (2)
  • (string) $name Unique name for the sitemap provider.
    Required: Yes
  • (WP_Sitemaps_Provider) $provider The `Sitemaps_Provider` instance implementing the sitemap.
    Required: Yes
Returns:
  • (bool) Returns true if the sitemap was added. False on failure.
Defined at:
Codex:

Registers a new sitemap provider.



Source

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

	if ( ! $sitemaps ) {
		return false;
	}

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