GC_Feed_Cache_Transient::__construct()

最后更新于:2021-11-27 15:16:24

GC_Feed_Cache_Transient::__construct( string$location, string$filename, string$extension)

Constructor.

参数

$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’.

源文件

文件: gc-includes/class-gc-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( 'gc_feed_cache_transient_lifetime', $lifetime, $filename );
	}