- Timestamp:
- 07/21/2020 03:27:48 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sitemaps/class-wp-sitemaps-registry.php
r48532 r48536 3 3 * Sitemaps: WP_Sitemaps_Registry class 4 4 * 5 * Handles registering sitemap s.5 * Handles registering sitemap providers. 6 6 * 7 7 * @package WordPress … … 17 17 class WP_Sitemaps_Registry { 18 18 /** 19 * Registered sitemap s.19 * Registered sitemap providers. 20 20 * 21 21 * @since 5.5.0 22 22 * 23 * @var WP_Sitemaps_Provider[] Array of registered sitemap s.23 * @var WP_Sitemaps_Provider[] Array of registered sitemap providers. 24 24 */ 25 private $ sitemaps = array();25 private $providers = array(); 26 26 27 27 /** … … 30 30 * @since 5.5.0 31 31 * 32 * @param string $name Name of the sitemap .32 * @param string $name Name of the sitemap provider. 33 33 * @param WP_Sitemaps_Provider $provider Instance of a WP_Sitemaps_Provider. 34 * @return bool True if the sitemapwas added, false if it is already registered.34 * @return bool True if the provider was added, false if it is already registered. 35 35 */ 36 public function add_ sitemap( $name, WP_Sitemaps_Provider $provider ) {37 if ( isset( $this-> sitemaps[ $name ] ) ) {36 public function add_provider( $name, WP_Sitemaps_Provider $provider ) { 37 if ( isset( $this->providers[ $name ] ) ) { 38 38 return false; 39 39 } 40 40 41 $this-> sitemaps[ $name ] = $provider;41 $this->providers[ $name ] = $provider; 42 42 43 43 return true; … … 45 45 46 46 /** 47 * Returns a single registered sitemap sprovider.47 * Returns a single registered sitemap provider. 48 48 * 49 49 * @since 5.5.0 … … 52 52 * @return WP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise. 53 53 */ 54 public function get_ sitemap( $name ) {55 if ( ! isset( $this-> sitemaps[ $name ] ) ) {54 public function get_provider( $name ) { 55 if ( ! isset( $this->providers[ $name ] ) ) { 56 56 return null; 57 57 } 58 58 59 return $this-> sitemaps[ $name ];59 return $this->providers[ $name ]; 60 60 } 61 61 … … 67 67 * @return WP_Sitemaps_Provider[] Array of sitemap providers. 68 68 */ 69 public function get_ sitemaps() {70 return $this-> sitemaps;69 public function get_providers() { 70 return $this->providers; 71 71 } 72 72 }
Note: See TracChangeset
for help on using the changeset viewer.