SimplePie::get_cache_filename()publicWP 1.0

Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL.

Method of the class: SimplePie{}

No Hooks.

Return

String. A filename (i.e. hash, without path and without extension).

Usage

$SimplePie = new SimplePie();
$SimplePie->get_cache_filename( $url );
$url(string) (required)
The URL of the feed to be cached.

SimplePie::get_cache_filename() code WP 6.5.2

public function get_cache_filename($url)
{
	// Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters.
	$url .= $this->force_feed ? '#force_feed' : '';
	$options = array();
	if ($this->timeout != 10)
	{
		$options[CURLOPT_TIMEOUT] = $this->timeout;
	}
	if ($this->useragent !== SIMPLEPIE_USERAGENT)
	{
		$options[CURLOPT_USERAGENT] = $this->useragent;
	}
	if (!empty($this->curl_options))
	{
		foreach ($this->curl_options as $k => $v)
		{
			$options[$k] = $v;
		}
	}
	if (!empty($options))
	{
		ksort($options);
		$url .= '#' . urlencode(var_export($options, true));
	}
	return call_user_func($this->cache_name_function, $url);
}