mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 09:34:41 +00: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. git-svn-id: https://develop.svn.wordpress.org/trunk@48540 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user