wp_register_sitemap_provider() WordPress Function

The wp_register_sitemap_provider() function allows a plugin to register a new sitemap provider. This function should be called from the provider's constructor.

wp_register_sitemap_provider( string $name, WP_Sitemaps_Provider $provider ) #

Registers a new sitemap provider.


Parameters

$name

(string)(Required)Unique name for the sitemap provider.

$provider

(WP_Sitemaps_Provider)(Required)The Sitemaps_Provider instance implementing the sitemap.


Top ↑

Return

(bool) Whether the sitemap was added.


Top ↑

Source

File: wp-includes/sitemaps.php

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

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


Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.