wp_feed_cache_transient_lifetime filter-hookWP 2.8.0

Filters the transient lifetime of the feed cache.

Usage

add_filter( 'wp_feed_cache_transient_lifetime', 'wp_kama_feed_cache_transient_lifetime_filter', 10, 2 );

/**
 * Function for `wp_feed_cache_transient_lifetime` filter-hook.
 * 
 * @param int    $lifetime Cache duration in seconds.
 * @param string $filename Unique identifier for the cache object.
 *
 * @return int
 */
function wp_kama_feed_cache_transient_lifetime_filter( $lifetime, $filename ){

	// filter...
	return $lifetime;
}
$lifetime(int)
Cache duration in seconds.
Default: 43200 seconds (12 hours)
$filename(string)
Unique identifier for the cache object.

Changelog

Since 2.8.0 Introduced.

Where the hook is called

WP_Feed_Cache_Transient::__construct()
wp_feed_cache_transient_lifetime
fetch_feed()
wp_feed_cache_transient_lifetime
wp-includes/class-wp-feed-cache-transient.php 67
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
wp-includes/feed.php 820
$feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );

Where the hook is used in WordPress

Usage not found.