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.


Top ↑

Return

(true) Always true.


Top ↑

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;
	}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.