SimplePie_Locator::is_feed

Advertisement

Syntax Syntax

SimplePie_Locator::is_feed( $file )

Source Source

File: wp-includes/SimplePie/Locator.php

		return null;
	}

	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

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.