WP_Feed_Cache_Transient::__construct( string $location, string $name, Base::TYPE_FEED|Base::TYPE_IMAGE $type )
- Since
- 2.8.0, 3.2.0, 6.7.0
- Source
wp-includes/class-wp-feed-cache-transient.php:58
Creates a new (transient) cache object.
Parameters
$locationstring- URL location (scheme is used to determine handler).
$namestring- Unique identifier for cache object.
$typeBase::TYPE_FEED|Base::TYPE_IMAGE- Either
TYPE_FEED('spc') for SimplePie data, orTYPE_IMAGE('spi') for image data.
Hooks fired · 1
One hook fires while WP_Feed_Cache_Transient::__construct() runs, in this order:
- apply_filters( wp_feed_cache_transient_lifetime )filterline 71 (+13 into the body)
Filters the transient lifetime of the feed cache.
Uses · 1
- apply_filters()Calls the callback functions that have been added to a filter hook.
Used by · 1
- WP_Feed_Cache::create()Creates a new SimplePie\Cache object.
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 ); }History
Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.7.0
Parameter names have been updated to be in line with the
SimplePie\Cache\Base interface.from the docblock3.2.0
Updated to use a PHP5 constructor.from the docblock
2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-includes/class-wp-feed-cache-transient.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.