WP_Feed_Cache_Transient::__construct() WordPress Method

The WP_Feed_Cache_Transient::__construct() function initializes the class and sets up the data structures for storing and managing the cache of feed objects.

WP_Feed_Cache_Transient::__construct( string $location, string $filename, string $extension ) #

Constructor.


Parameters

$location

(string)(Required)URL location (scheme is used to determine handler).

$filename

(string)(Required)Unique identifier for cache object.

$extension

(string)(Required)'spi' or 'spc'.


Top ↑

Source

File: wp-includes/class-wp-feed-cache-transient.php

	public function __construct( $location, $filename, $extension ) {
		$this->name     = 'feed_' . $filename;
		$this->mod_name = 'feed_mod_' . $filename;

		$lifetime = $this->lifetime;
		/**
		 * Filters the transient lifetime of the feed cache.
		 *
		 * @since 2.8.0
		 *
		 * @param int    $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
		 * @param string $filename Unique identifier for the cache object.
		 */
		$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.2.0Updated to use a PHP5 constructor.
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.