Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_feed_cache_transient_lifetime

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
17
18 class WP_Feed_Cache_Transient {
19      var $name;
20      var $mod_name;
21      var $lifetime = 43200; //Default lifetime in cache of 12 hours
22
23      function __construct($location, $filename, $extension) {
24           $this->name = 'feed_' . $filename;
25           $this->mod_name = 'feed_mod_' . $filename;
26           $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename);
27      }
28
29      function save($data) {
30           if ( is_a($data, 'SimplePie') )
31                $data = $data->data;
32
33           set_transient($this->name, $data, $this->lifetime);
34           set_transient($this->mod_name, time(), $this->lifetime);
35           return true;