wp_feed_cache_transient_lifetime
Filter HookDescription
Filters the transient lifetime of the feed cache.Hook Information
File Location |
wp-includes/class-wp-feed-cache-transient.php
View on GitHub
|
Hook Type | Filter |
Line Number | 70 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$lifetime
|
Cache duration in seconds. Default is 43200 seconds (12 hours). |
string
|
$name
|
Unique identifier for the cache object. |
Usage Examples
Basic Usage
<?php
// Hook into wp_feed_cache_transient_lifetime
add_filter('wp_feed_cache_transient_lifetime', 'my_custom_filter', 10, 2);
function my_custom_filter($lifetime, $name) {
// Your custom filtering logic here
return $lifetime;
}
Source Code Context
wp-includes/class-wp-feed-cache-transient.php:70
- How this hook is used in WordPress core
<?php
65 * @since 2.8.0
66 *
67 * @param int $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
68 * @param string $name Unique identifier for the cache object.
69 */
70 $this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $name );
71 }
72
73 /**
74 * Saves data to the transient.
75 *
PHP Documentation
<?php
/**
* 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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/class-wp-feed-cache-transient.php
Related Hooks
Related hooks will be displayed here in future updates.