WP_Feed_Cache_Transient::save() WordPress Method
The WP_Feed_Cache_Transient::save() method is used to save an RSS feed to a transient cache. This is a quick way to save and retrieve an RSS feed without having to hit the server each time.
WP_Feed_Cache_Transient::save( SimplePie $data ) #
Sets the transient.
Parameters
- $data
(SimplePie)(Required)Data to save.
Return
(true) Always true.
Source
File: wp-includes/class-wp-feed-cache-transient.php
public function save( $data ) { if ( $data instanceof SimplePie ) { $data = $data->data; } set_transient( $this->name, $data, $this->lifetime ); set_transient( $this->mod_name, time(), $this->lifetime ); return true; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |