This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
@@ -12,6 +12,7 @@
*
* @since 2.8.0
* @since 6.7.0 Now properly implements the SimplePie\Cache\Base interface.
* @since 6.9.0 Switched to Multisite's global cache via the `*_site_transient()` functions.
*/
#[AllowDynamicProperties]
class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
@@ -84,8 +85,8 @@ class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
$data = $data->data;
}
set_transient( $this->name, $data, $this->lifetime );
set_transient( $this->mod_name, time(), $this->lifetime );
set_site_transient( $this->name, $data, $this->lifetime );
set_site_transient( $this->mod_name, time(), $this->lifetime );
return true;
}
@@ -97,7 +98,7 @@ class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
* @return array Data for `SimplePie::$data`.
*/
public function load() {
return get_transient( $this->name );
return get_site_transient( $this->name );
}
/**
@@ -108,7 +109,7 @@ class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
* @return int Timestamp.
*/
public function mtime() {
return get_transient( $this->mod_name );
return get_site_transient( $this->mod_name );
}
/**
@@ -119,7 +120,7 @@ class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
* @return bool False if value was not set and true if value was set.
*/
public function touch() {
return set_transient( $this->mod_name, time(), $this->lifetime );
return set_site_transient( $this->mod_name, time(), $this->lifetime );
}
/**
@@ -130,8 +131,8 @@ class WP_Feed_Cache_Transient implements SimplePie\Cache\Base {
* @return true Always true.
*/
public function unlink() {
delete_transient( $this->name );
delete_transient( $this->mod_name );
delete_site_transient( $this->name );
delete_site_transient( $this->mod_name );
return true;
}
}