Skip to content
Snippets Groups Projects
Select Git revision
  • d9d2a154a220ba5fa29c3d80cb7a83ef21337cac
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
36 results

class-wp-feed-cache-transient.php

Blame
  • class-wp-feed-cache-transient.php 2.48 KiB
    <?php
    /**
     * Feed API: WP_Feed_Cache_Transient class
     *
     * @package WordPress
     * @subpackage Feed
     * @since 4.7.0
     */
    
    /**
     * Core class used to implement feed cache transients.
     *
     * @since 2.8.0
     */
    class WP_Feed_Cache_Transient {
    
    	/**
    	 * Holds the transient name.
    	 *
    	 * @since 2.8.0
    	 * @var string
    	 */
    	public $name;
    
    	/**
    	 * Holds the transient mod name.
    	 *
    	 * @since 2.8.0
    	 * @var string
    	 */
    	public $mod_name;
    
    	/**
    	 * Holds the cache duration in seconds.
    	 *
    	 * Defaults to 43200 seconds (12 hours).
    	 *
    	 * @since 2.8.0
    	 * @var int
    	 */
    	public $lifetime = 43200;
    
    	/**
    	 * Constructor.
    	 *
    	 * @since 2.8.0
    	 * @since 3.2.0 Updated to use a PHP5 constructor.
    	 *
    	 * @param string $location  URL location (scheme is used to determine handler).
    	 * @param string $filename  Unique identifier for cache object.
    	 * @param string $extension 'spi' or 'spc'.
    	 */
    	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);
    	}
    
    	/**
    	 * Sets the transient.