WP_Feed_Cache_Transient::__construct( string $location, string $name, Base::TYPE_FEED|Base::TYPE_IMAGE $type )

In this article

Creates a new (transient) cache object.

Parameters

$locationstringrequired
URL location (scheme is used to determine handler).
$namestringrequired
Unique identifier for cache object.
$typeBase::TYPE_FEED|Base::TYPE_IMAGErequired
Either TYPE_FEED ('spc') for SimplePie data, or TYPE_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.

Changelog

VersionDescription
6.7.0Parameter names have been updated to be in line with the SimplePieCacheBase interface.
3.2.0Updated to use a PHP5 constructor.
2.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.