WP_Sitemaps_Registry::get_provider()publicWP 5.5.0

Returns a single registered sitemap provider.

Method of the class: WP_Sitemaps_Registry{}

No Hooks.

Return

WP_Sitemaps_Provider|null. Sitemap provider if it exists, null otherwise.

Usage

$WP_Sitemaps_Registry = new WP_Sitemaps_Registry();
$WP_Sitemaps_Registry->get_provider( $name );
$name(string) (required)
Sitemap provider name.

Changelog

Since 5.5.0 Introduced.

WP_Sitemaps_Registry::get_provider() code WP 6.5.3

public function get_provider( $name ) {
	if ( ! is_string( $name ) || ! isset( $this->providers[ $name ] ) ) {
		return null;
	}

	return $this->providers[ $name ];
}