sitemaps[ $name ] ) ) { return false; } $this->sitemaps[ $name ] = $provider; return true; } /** * Returns a single registered sitemaps provider. * * @since 5.5.0 * * @param string $name Sitemap provider name. * @return WP_Sitemaps_Provider|null Sitemaps provider if it exists, null otherwise. */ public function get_sitemap( $name ) { if ( ! isset( $this->sitemaps[ $name ] ) ) { return null; } return $this->sitemaps[ $name ]; } /** * Lists all registered sitemaps. * * @since 5.5.0 * * @return array List of sitemaps. */ public function get_sitemaps() { $total_sitemaps = count( $this->sitemaps ); if ( $total_sitemaps > $this->max_sitemaps ) { return array_slice( $this->sitemaps, 0, $this->max_sitemaps, true ); } return $this->sitemaps; } }