WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/wp feed cache transient lifetime

Description

A filter hook called by the get_category_feed_link function prior to printing out in a template.

Usage

<?php
function filter_handler$seconds ) {
    
// ...
}

add_filter'wp_feed_cache_transient_lifetime' 'filter_handler' ); ?>

Parameters

$seconds
(int) (') Time in seconds between cache recreation.
Default: 43200

Return Values

(int) 
$seconds.

Examples

<?php
function return_7200$seconds ) {
  
// change the default feed cache recreation period to 2 hours
  
return 7200;
}

add_filter'wp_feed_cache_transient_lifetime' 'return_7200' );
$feed fetch_feed$feed_url );
remove_filter'wp_feed_cache_transient_lifetime' 'return_7200' );
?>

Source File

wp_feed_cache_transient_lifetime is located in wp-includes/class-feed.php.

Related

See Also

Plugin_API/Filter_Reference