WP_Feed_Cache_Transient::__construct │ public │ WP 2.8.0

Creates a new (transient) cache object.

Метод класса: WP_Feed_Cache_Transient{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

$WP_Feed_Cache_Transient = new WP_Feed_Cache_Transient();
$WP_Feed_Cache_Transient->__construct( $location, $name, $type );
$location(строка) (обязательный)
URL location (scheme is used to determine handler).
$name(строка) (обязательный)
Unique identifier for cache object.
$type(Base::TYPE_FEED|Base::TYPE_IMAGE) (обязательный)
Either TYPE_FEED ('spc') for SimplePie data, or TYPE_IMAGE ('spi') for image data.

Список изменений

С версии 2.8.0 Введена.
С версии 3.2.0 Updated to use a PHP5 constructor.
С версии 6.7.0 Parameter names have been updated to be in line with the SimplePie\Cache\Base interface.

Код WP_Feed_Cache_Transient::__construct() WP 7.1.4

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

	$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 $name     Unique identifier for the cache object.
	 */
	$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $name );
}