Make WordPress Core


Ignore:
Timestamp:
07/21/2020 03:55:21 PM (4 years ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php

    r48536 r48540  
    99        $registry = new WP_Sitemaps_Registry();
    1010
    11         $actual   = $registry->add_provider( 'foo', $provider );
    12         $sitemaps = $registry->get_providers();
     11        $actual    = $registry->add_provider( 'foo', $provider );
     12        $providers = $registry->get_providers();
    1313
    1414        $this->assertTrue( $actual );
    15         $this->assertCount( 1, $sitemaps );
    16         $this->assertSame( $sitemaps['foo'], $provider, 'Can not confirm sitemap registration is working.' );
     15        $this->assertCount( 1, $providers );
     16        $this->assertSame( $providers['foo'], $provider, 'Can not confirm sitemap registration is working.' );
    1717    }
    1818
     
    2222        $registry  = new WP_Sitemaps_Registry();
    2323
    24         $actual1  = $registry->add_provider( 'foo', $provider1 );
    25         $actual2  = $registry->add_provider( 'foo', $provider2 );
    26         $sitemaps = $registry->get_providers();
     24        $actual1   = $registry->add_provider( 'foo', $provider1 );
     25        $actual2   = $registry->add_provider( 'foo', $provider2 );
     26        $providers = $registry->get_providers();
    2727
    2828        $this->assertTrue( $actual1 );
    2929        $this->assertFalse( $actual2 );
    30         $this->assertCount( 1, $sitemaps );
    31         $this->assertSame( $sitemaps['foo'], $provider1, 'Can not confirm sitemap registration is working.' );
     30        $this->assertCount( 1, $providers );
     31        $this->assertSame( $providers['foo'], $provider1, 'Can not confirm sitemap registration is working.' );
    3232    }
    3333}
Note: See TracChangeset for help on using the changeset viewer.