Welcome, visitor! Log in
 

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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
26
27 class WP_Feed_Cache_Transient {
28      var $name;
29      var $mod_name;
30      var $lifetime = 43200; //Default lifetime in cache of 12 hours
31
32      function WP_Feed_Cache_Transient($location, $filename, $extension) {
33           $this->name = 'feed_' . $filename;
34           $this->mod_name = 'feed_mod_' . $filename;
35           $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime);
36      }
37
38      function save($data) {
39           if ( is_a($data, 'SimplePie') )
40                $data = $data->data;
41
42           set_transient($this->name, $data, $this->lifetime);
43           set_transient($this->mod_name, time(), $this->lifetime);
44           return true;