示例#1
0
/**
 * Set the stale if error directive.
 *
 * @param  int $seconds The TTL for stale if error.
 * @return array                All of the cache control headers.
 */
function purgely_set_stale_if_error($seconds)
{
    $purgely = get_purgely_instance();
    return $purgely->add_cache_control_header($seconds, 'stale-if-error');
}
示例#2
0
    public function add_cache_control_header($seconds, $directive)
    {
        $header = new Purgely_Cache_Control_Header($seconds, $directive);
        $headers = $this::$cache_control_headers;
        $headers[] = $header;
        $this::$cache_control_headers = $headers;
        return $this::$cache_control_headers;
    }
    /**
     * Load the plugin text domain.
     *
     * @since 1.0.0.
     *
     * @return void
     */
    public function load_plugin_textdomain()
    {
        load_plugin_textdomain('purgely', false, basename(dirname(__FILE__)) . '/languages/');
    }
}
/**
 * Instantiate or return the one Purgely instance.
 *
 * @return Purgely
 */
function get_purgely_instance()
{
    return Purgely::instance();
}
get_purgely_instance();