WP_Feed_Cache_Transient::__construct()publicWP 2.8.0

Creates a new (transient) cache object.

Method of the class: WP_Feed_Cache_Transient{}

Hooks from the method

Return

null. Nothing (null).

Usage

$WP_Feed_Cache_Transient = new WP_Feed_Cache_Transient();
$WP_Feed_Cache_Transient->__construct( $location, $name, $type );
$location(string) (required)
URL location (scheme is used to determine handler).
$name(string) (required)
Unique identifier for cache object.
$type(Base::TYPE_FEED|Base::TYPE_IMAGE) (required)
Either TYPE_FEED ('spc') for SimplePie data, or TYPE_IMAGE ('spi') for image data.

Changelog

Since 2.8.0 Introduced.
Since 3.2.0 Updated to use a PHP5 constructor.
Since 6.7.0 Parameter names have been updated to be in line with the SimplePie\Cache\Base interface.

WP_Feed_Cache_Transient::__construct() code WP 6.7.1

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 );
}