Sitemaps: Rename wp_register_sitemap()
to wp_register_sitemap_provider()
.
Follow-up to [48536], [48540], [48541]. Props pbiron. Fixes #50724. git-svn-id: https://develop.svn.wordpress.org/trunk@48553 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
44335fdc43
commit
26362089c5
@ -63,7 +63,7 @@ function wp_get_sitemap_providers() {
|
|||||||
* @param WP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap.
|
* @param WP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap.
|
||||||
* @return bool Returns true if the sitemap was added. False on failure.
|
* @return bool Returns true if the sitemap was added. False on failure.
|
||||||
*/
|
*/
|
||||||
function wp_register_sitemap( $name, WP_Sitemaps_Provider $provider ) {
|
function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) {
|
||||||
$sitemaps = wp_sitemaps_get_server();
|
$sitemaps = wp_sitemaps_get_server();
|
||||||
return $sitemaps->registry->add_provider( $name, $provider );
|
return $sitemaps->registry->add_provider( $name, $provider );
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ class Test_Sitemaps extends WP_UnitTestCase {
|
|||||||
* Test functionality that adds a new sitemap provider to the registry.
|
* Test functionality that adds a new sitemap provider to the registry.
|
||||||
*/
|
*/
|
||||||
public function test_register_sitemap_provider() {
|
public function test_register_sitemap_provider() {
|
||||||
wp_register_sitemap( 'test_sitemap', self::$test_provider );
|
wp_register_sitemap_provider( 'test_sitemap', self::$test_provider );
|
||||||
|
|
||||||
$sitemaps = wp_get_sitemap_providers();
|
$sitemaps = wp_get_sitemap_providers();
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ class Test_Sitemaps extends WP_UnitTestCase {
|
|||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*/
|
*/
|
||||||
public function test_empty_url_list_should_return_404() {
|
public function test_empty_url_list_should_return_404() {
|
||||||
wp_register_sitemap( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) );
|
wp_register_sitemap_provider( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) );
|
||||||
|
|
||||||
$this->go_to( home_url( '/?sitemap=foo' ) );
|
$this->go_to( home_url( '/?sitemap=foo' ) );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user