wp/wp-includes/sitemaps/class-wp-sitemaps-registry.php
changeset 21 48c4eec2b7e6
parent 16 a86126ab1dd4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    12 /**
    12 /**
    13  * Class WP_Sitemaps_Registry.
    13  * Class WP_Sitemaps_Registry.
    14  *
    14  *
    15  * @since 5.5.0
    15  * @since 5.5.0
    16  */
    16  */
       
    17 #[AllowDynamicProperties]
    17 class WP_Sitemaps_Registry {
    18 class WP_Sitemaps_Registry {
    18 	/**
    19 	/**
    19 	 * Registered sitemap providers.
    20 	 * Registered sitemap providers.
    20 	 *
    21 	 *
    21 	 * @since 5.5.0
    22 	 * @since 5.5.0
    63 	 *
    64 	 *
    64 	 * @param string $name Sitemap provider name.
    65 	 * @param string $name Sitemap provider name.
    65 	 * @return WP_Sitemaps_Provider|null Sitemap provider if it exists, null otherwise.
    66 	 * @return WP_Sitemaps_Provider|null Sitemap provider if it exists, null otherwise.
    66 	 */
    67 	 */
    67 	public function get_provider( $name ) {
    68 	public function get_provider( $name ) {
    68 		if ( ! isset( $this->providers[ $name ] ) ) {
    69 		if ( ! is_string( $name ) || ! isset( $this->providers[ $name ] ) ) {
    69 			return null;
    70 			return null;
    70 		}
    71 		}
    71 
    72 
    72 		return $this->providers[ $name ];
    73 		return $this->providers[ $name ];
    73 	}
    74 	}