From ed75e5b5e5199477e45ba87b41915eda08f45bbf Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Tue, 21 Jul 2020 12:51:50 -0600
Subject: [PATCH] Rename wp_register_sitemap() to
wp_register_sitemap_provider().
---
src/wp-includes/sitemaps.php | 2 +-
tests/phpunit/tests/sitemaps/sitemaps.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/wp-includes/sitemaps.php b/src/wp-includes/sitemaps.php
index 214eb3ac1a..f3bd6d1dfc 100644
|
a
|
b
|
function wp_get_sitemap_providers() { |
| 63 | 63 | * @param WP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap. |
| 64 | 64 | * @return bool Returns true if the sitemap was added. False on failure. |
| 65 | 65 | */ |
| 66 | | function wp_register_sitemap( $name, WP_Sitemaps_Provider $provider ) { |
| | 66 | function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) { |
| 67 | 67 | $sitemaps = wp_sitemaps_get_server(); |
| 68 | 68 | return $sitemaps->registry->add_provider( $name, $provider ); |
| 69 | 69 | } |
diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php
index b1f4b0557d..a2f134053a 100644
|
a
|
b
|
class Test_Sitemaps extends WP_UnitTestCase { |
| 389 | 389 | * Test functionality that adds a new sitemap provider to the registry. |
| 390 | 390 | */ |
| 391 | 391 | public function test_register_sitemap_provider() { |
| 392 | | wp_register_sitemap( 'test_sitemap', self::$test_provider ); |
| | 392 | wp_register_sitemap_provider( 'test_sitemap', self::$test_provider ); |
| 393 | 393 | |
| 394 | 394 | $sitemaps = wp_get_sitemap_providers(); |
| 395 | 395 | |
| … |
… |
class Test_Sitemaps extends WP_UnitTestCase { |
| 481 | 481 | * @preserveGlobalState disabled |
| 482 | 482 | */ |
| 483 | 483 | public function test_empty_url_list_should_return_404() { |
| 484 | | wp_register_sitemap( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) ); |
| | 484 | wp_register_sitemap_provider( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) ); |
| 485 | 485 | |
| 486 | 486 | $this->go_to( home_url( '/?sitemap=foo' ) ); |
| 487 | 487 | |