Allow plugins to filter the expiration time of the SimplePie cache. Fixes #9926.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
13c7249671
commit
084280b76e
|
@ -25,26 +25,22 @@ class WP_Feed_Cache extends SimplePie_Cache {
|
|||
}
|
||||
|
||||
class WP_Feed_Cache_Transient {
|
||||
var $location;
|
||||
var $filename;
|
||||
var $extension;
|
||||
var $name;
|
||||
var $mod_name;
|
||||
var $lifetime = 43200; //Default lifetime in cache of 12 hours
|
||||
|
||||
function WP_Feed_Cache_Transient($location, $filename, $extension) {
|
||||
//$this->location = $location;
|
||||
//$this->filename = rawurlencode($filename);
|
||||
//$this->extension = rawurlencode($extension);
|
||||
//$this->name = "$location/$this->filename.$this->extension";
|
||||
$this->name = 'feed_' . $filename;
|
||||
$this->mod_name = 'feed_mod_' . $filename;
|
||||
$this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename);
|
||||
}
|
||||
|
||||
function save($data) {
|
||||
if ( is_a($data, 'SimplePie') )
|
||||
$data = $data->data;
|
||||
|
||||
set_transient($this->name, $data, 43200);
|
||||
set_transient($this->mod_name, time(), 43200);
|
||||
set_transient($this->name, $data, $this->lifetime);
|
||||
set_transient($this->mod_name, time(), $this->lifetime);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -57,7 +53,7 @@ class WP_Feed_Cache_Transient {
|
|||
}
|
||||
|
||||
function touch() {
|
||||
return set_transient($this->mod_name, time(), 43200);
|
||||
return set_transient($this->mod_name, time(), $this->lifetime);
|
||||
}
|
||||
|
||||
function unlink() {
|
||||
|
|
Loading…
Reference in New Issue