From 8c7fe179daf818c547d12be81ded439d7503c8c5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 21 Jul 2020 16:04:35 +0000 Subject: [PATCH] Sitemaps: Rename `wp_get_sitemaps_providers()` to `wp_get_sitemap_providers()`. Follow-up to [48536], [48540]. Props pbiron, swissspidy, SergeyBiryukov. See #50724. git-svn-id: https://develop.svn.wordpress.org/trunk@48541 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/sitemaps.php | 2 +- tests/phpunit/tests/sitemaps/functions.php | 6 +++--- tests/phpunit/tests/sitemaps/sitemaps.php | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/wp-includes/sitemaps.php b/src/wp-includes/sitemaps.php index 6bc4d71e69..214eb3ac1a 100644 --- a/src/wp-includes/sitemaps.php +++ b/src/wp-includes/sitemaps.php @@ -49,7 +49,7 @@ function wp_sitemaps_get_server() { * * @return WP_Sitemaps_Provider[] Array of sitemap providers. */ -function wp_get_sitemaps_providers() { +function wp_get_sitemap_providers() { $sitemaps = wp_sitemaps_get_server(); return $sitemaps->registry->get_providers(); } diff --git a/tests/phpunit/tests/sitemaps/functions.php b/tests/phpunit/tests/sitemaps/functions.php index 2c4cce5a35..3fe904a6ae 100644 --- a/tests/phpunit/tests/sitemaps/functions.php +++ b/tests/phpunit/tests/sitemaps/functions.php @@ -41,10 +41,10 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { } /** - * Test wp_get_sitemaps default functionality + * Test wp_get_sitemap_providers default functionality. */ - public function test_wp_get_sitemaps_providers() { - $sitemaps = wp_get_sitemaps_providers(); + public function test_wp_get_sitemap_providers() { + $sitemaps = wp_get_sitemap_providers(); $expected = array( 'posts' => 'WP_Sitemaps_Posts', diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php index d00e89d163..b1f4b0557d 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps.php +++ b/tests/phpunit/tests/sitemaps/sitemaps.php @@ -100,7 +100,7 @@ class Test_Sitemaps extends WP_UnitTestCase { public function _get_sitemap_entries() { $entries = array(); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); foreach ( $providers as $provider ) { // Using `array_push` is more efficient than `array_merge` in the loop. @@ -218,7 +218,7 @@ class Test_Sitemaps extends WP_UnitTestCase { * Tests getting a URL list for post type post. */ public function test_get_url_list_post() { - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, 'post' ); @@ -234,7 +234,7 @@ class Test_Sitemaps extends WP_UnitTestCase { // Short circuit the show on front option. add_filter( 'pre_option_show_on_front', '__return_true' ); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, 'page' ); @@ -247,7 +247,7 @@ class Test_Sitemaps extends WP_UnitTestCase { * Tests getting a URL list for post type page with included home page. */ public function test_get_url_list_page_with_home() { - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, 'page' ); @@ -270,7 +270,7 @@ class Test_Sitemaps extends WP_UnitTestCase { public function test_get_url_list_private_post() { wp_set_current_user( self::$editor_id ); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list_before = $providers['posts']->get_url_list( 1, 'post' ); @@ -297,7 +297,7 @@ class Test_Sitemaps extends WP_UnitTestCase { $ids = self::factory()->post->create_many( 10, array( 'post_type' => $post_type ) ); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, $post_type ); @@ -320,7 +320,7 @@ class Test_Sitemaps extends WP_UnitTestCase { self::factory()->post->create_many( 10, array( 'post_type' => $post_type ) ); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, $post_type ); @@ -348,7 +348,7 @@ class Test_Sitemaps extends WP_UnitTestCase { self::factory()->post->create_many( 10, array( 'post_type' => $post_type ) ); - $providers = wp_get_sitemaps_providers(); + $providers = wp_get_sitemap_providers(); $post_list = $providers['posts']->get_url_list( 1, $post_type ); @@ -391,7 +391,7 @@ class Test_Sitemaps extends WP_UnitTestCase { public function test_register_sitemap_provider() { wp_register_sitemap( 'test_sitemap', self::$test_provider ); - $sitemaps = wp_get_sitemaps_providers(); + $sitemaps = wp_get_sitemap_providers(); $this->assertEquals( $sitemaps['test_sitemap'], self::$test_provider, 'Can not confirm sitemap registration is working.' ); }