WordPress at Your Fingertips
function is not described

SimplePie_Locator::is_feed() public WP 1.0

{} It's a method of the class: SimplePie_Locator{}

No Hooks.

Return

null. Nothing.

Usage

$SimplePie_Locator = new SimplePie_Locator();
$SimplePie_Locator->is_feed( $file, $check_html );
$file (required)
-
$check_html **
-
Default: false

Code of SimplePie_Locator::is_feed() WP 5.8.2

public function is_feed($file, $check_html = false)
{
	if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
	{
		$sniffer = $this->registry->create('Content_Type_Sniffer', array($file));
		$sniffed = $sniffer->get_type();
		$mime_types = array('application/rss+xml', 'application/rdf+xml',
		                    'text/rdf', 'application/atom+xml', 'text/xml',
		                    'application/xml', 'application/x-rss+xml');
		if ($check_html)
		{
			$mime_types[] = 'text/html';
		}

		return in_array($sniffed, $mime_types);
	}
	elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)
	{
		return true;
	}
	else
	{
		return false;
	}
}