mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Sitemaps: Rename wp_get_sitemaps()
to wp_get_sitemaps_providers()
Following [48536], rename the function to match the rest of the sitemaps logic. Also eliminates some dead code after [48523]. Props pbiron. See #50724. See #50643. Built from https://develop.svn.wordpress.org/trunk@48540 git-svn-id: http://core.svn.wordpress.org/trunk@48302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1c52ad8d3f
commit
694b407297
@ -22,8 +22,6 @@
|
||||
function wp_sitemaps_get_server() {
|
||||
global $wp_sitemaps;
|
||||
|
||||
$is_enabled = (bool) get_option( 'blog_public' );
|
||||
|
||||
// If there isn't a global instance, set and bootstrap the sitemaps system.
|
||||
if ( empty( $wp_sitemaps ) ) {
|
||||
$wp_sitemaps = new WP_Sitemaps();
|
||||
@ -51,13 +49,8 @@ function wp_sitemaps_get_server() {
|
||||
*
|
||||
* @return WP_Sitemaps_Provider[] Array of sitemap providers.
|
||||
*/
|
||||
function wp_get_sitemaps() {
|
||||
function wp_get_sitemaps_providers() {
|
||||
$sitemaps = wp_sitemaps_get_server();
|
||||
|
||||
if ( ! $sitemaps ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
return $sitemaps->registry->get_providers();
|
||||
}
|
||||
|
||||
@ -72,11 +65,6 @@ function wp_get_sitemaps() {
|
||||
*/
|
||||
function wp_register_sitemap( $name, WP_Sitemaps_Provider $provider ) {
|
||||
$sitemaps = wp_sitemaps_get_server();
|
||||
|
||||
if ( ! $sitemaps ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $sitemaps->registry->add_provider( $name, $provider );
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ class WP_Sitemaps_Registry {
|
||||
* @since 5.5.0
|
||||
*
|
||||
* @param string $name Sitemap provider name.
|
||||
* @return WP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise.
|
||||
* @return WP_Sitemaps_Provider|null Sitemap provider if it exists, null otherwise.
|
||||
*/
|
||||
public function get_provider( $name ) {
|
||||
if ( ! isset( $this->providers[ $name ] ) ) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5-beta2-48539';
|
||||
$wp_version = '5.5-beta2-48540';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user