You appear to be a bot. Output may be restricted
Description
Try to get the sitemap from cache.
Usage
$bool = WPSEO_Sitemaps::get_sitemap_from_cache( $type, $page_number );
Parameters
- $type
- ( string ) required – Sitemap type.
- $page_number
- ( int ) required – The page number to retrieve.
Returns
bool If the sitemap has been retrieved from cache.
Source
File name: wordpress-seo/inc/sitemaps/class-sitemaps.php
Lines:
1 to 30 of 30
private function get_sitemap_from_cache( $type, $page_number ) { $this->transient = false; if ( $this->cache->is_enabled() !== true ) { return false; } /** * Fires before the attempt to retrieve XML sitemap from the transient cache. * * @param WPSEO_Sitemaps $sitemaps Sitemaps object. */ do_action( 'wpseo_sitemap_stylesheet_cache_' . $type, $this ); $sitemap_cache_data = $this->cache->get_sitemap_data( $type, $page_number ); // No cache was found, refresh it because cache is enabled. if ( empty( $sitemap_cache_data ) ) { return $this->refresh_sitemap_cache( $type, $page_number ); } // Cache object was found, parse information. $this->transient = true; $this->sitemap = $sitemap_cache_data->get_sitemap(); $this->bad_sitemap = ! $sitemap_cache_data->is_usable(); return true; }