Creates a new (transient) cache object.
Parameters
$location
stringrequired- URL location (scheme is used to determine handler).
$name
stringrequired- Unique identifier for cache object.
$type
Base::TYPE_FEED|Base::TYPE_IMAGErequired- Either
TYPE_FEED
('spc'
) for SimplePie data, orTYPE_IMAGE
('spi'
) for image data.
Source
public function __construct( $location, $name, $type ) {
$this->name = 'feed_' . $name;
$this->mod_name = 'feed_mod_' . $name;
$lifetime = $this->lifetime;
/**
* Filters the transient lifetime of the feed cache.
*
* @since 2.8.0
*
* @param int $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
* @param string $name Unique identifier for the cache object.
*/
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $name );
}
Hooks
- apply_filters( ‘wp_feed_cache_transient_lifetime’,
int $lifetime ,string $name ) Filters the transient lifetime of the feed cache.
User Contributed Notes
You must log in before being able to contribute a note or feedback.