diff --git a/wp-includes/sitemaps.php b/wp-includes/sitemaps.php index 9600540156..f556246be5 100644 --- a/wp-includes/sitemaps.php +++ b/wp-includes/sitemaps.php @@ -58,7 +58,7 @@ function wp_get_sitemaps() { return array(); } - return $sitemaps->registry->get_sitemaps(); + return $sitemaps->registry->get_providers(); } /** @@ -77,7 +77,7 @@ function wp_register_sitemap( $name, WP_Sitemaps_Provider $provider ) { return false; } - return $sitemaps->registry->add_sitemap( $name, $provider ); + return $sitemaps->registry->add_provider( $name, $provider ); } /** diff --git a/wp-includes/sitemaps/class-wp-sitemaps-index.php b/wp-includes/sitemaps/class-wp-sitemaps-index.php index 91ceea0ae0..9449b4b6a4 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-index.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-index.php @@ -54,7 +54,7 @@ class WP_Sitemaps_Index { public function get_sitemap_list() { $sitemaps = array(); - $providers = $this->registry->get_sitemaps(); + $providers = $this->registry->get_providers(); /* @var WP_Sitemaps_Provider $provider */ foreach ( $providers as $name => $provider ) { $sitemap_entries = $provider->get_sitemap_entries(); diff --git a/wp-includes/sitemaps/class-wp-sitemaps-registry.php b/wp-includes/sitemaps/class-wp-sitemaps-registry.php index c95f04c77f..1235670a27 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-registry.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-registry.php @@ -2,7 +2,7 @@ /** * Sitemaps: WP_Sitemaps_Registry class * - * Handles registering sitemaps. + * Handles registering sitemap providers. * * @package WordPress * @subpackage Sitemaps @@ -16,47 +16,47 @@ */ class WP_Sitemaps_Registry { /** - * Registered sitemaps. + * Registered sitemap providers. * * @since 5.5.0 * - * @var WP_Sitemaps_Provider[] Array of registered sitemaps. + * @var WP_Sitemaps_Provider[] Array of registered sitemap providers. */ - private $sitemaps = array(); + private $providers = array(); /** * Adds a sitemap with route to the registry. * * @since 5.5.0 * - * @param string $name Name of the sitemap. + * @param string $name Name of the sitemap provider. * @param WP_Sitemaps_Provider $provider Instance of a WP_Sitemaps_Provider. - * @return bool True if the sitemap was added, false if it is already registered. + * @return bool True if the provider was added, false if it is already registered. */ - public function add_sitemap( $name, WP_Sitemaps_Provider $provider ) { - if ( isset( $this->sitemaps[ $name ] ) ) { + public function add_provider( $name, WP_Sitemaps_Provider $provider ) { + if ( isset( $this->providers[ $name ] ) ) { return false; } - $this->sitemaps[ $name ] = $provider; + $this->providers[ $name ] = $provider; return true; } /** - * Returns a single registered sitemaps provider. + * Returns a single registered sitemap provider. * * @since 5.5.0 * * @param string $name Sitemap provider name. * @return WP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise. */ - public function get_sitemap( $name ) { - if ( ! isset( $this->sitemaps[ $name ] ) ) { + public function get_provider( $name ) { + if ( ! isset( $this->providers[ $name ] ) ) { return null; } - return $this->sitemaps[ $name ]; + return $this->providers[ $name ]; } /** @@ -66,7 +66,7 @@ class WP_Sitemaps_Registry { * * @return WP_Sitemaps_Provider[] Array of sitemap providers. */ - public function get_sitemaps() { - return $this->sitemaps; + public function get_providers() { + return $this->providers; } } diff --git a/wp-includes/sitemaps/class-wp-sitemaps.php b/wp-includes/sitemaps/class-wp-sitemaps.php index 828e7931dc..01f1bf8b35 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps.php +++ b/wp-includes/sitemaps/class-wp-sitemaps.php @@ -135,7 +135,7 @@ class WP_Sitemaps { // Register each supported provider. /* @var WP_Sitemaps_Provider $provider */ foreach ( $providers as $name => $provider ) { - $this->registry->add_sitemap( $name, $provider ); + $this->registry->add_provider( $name, $provider ); } } @@ -212,7 +212,7 @@ class WP_Sitemaps { exit; } - $provider = $this->registry->get_sitemap( $sitemap ); + $provider = $this->registry->get_provider( $sitemap ); if ( ! $provider ) { return; diff --git a/wp-includes/version.php b/wp-includes/version.php index 2637b0bff2..74277841df 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta2-48535'; +$wp_version = '5.5-beta2-48536'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.