WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

SimplePie_Content_Type_Sniffer::feed_or_html() public WP 1.0

Sniff HTML

{} Это метод класса: SimplePie_Content_Type_Sniffer{}

Хуков нет.

Возвращает

Строку. Actual Content-Type

Использование

$SimplePie_Content_Type_Sniffer = new SimplePie_Content_Type_Sniffer();
$SimplePie_Content_Type_Sniffer->feed_or_html();

Код SimplePie_Content_Type_Sniffer::feed_or_html() WP 5.5.3

<?php
public function feed_or_html()
{
	$len = strlen($this->file->body);
	$pos = strspn($this->file->body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");

	while ($pos < $len)
	{
		switch ($this->file->body[$pos])
		{
			case "\x09":
			case "\x0A":
			case "\x0D":
			case "\x20":
				$pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos);
				continue 2;

			case '<':
				$pos++;
				break;

			default:
				return 'text/html';
		}

		if (substr($this->file->body, $pos, 3) === '!--')
		{
			$pos += 3;
			if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false)
			{
				$pos += 3;
			}
			else
			{
				return 'text/html';
			}
		}
		elseif (substr($this->file->body, $pos, 1) === '!')
		{
			if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false)
			{
				$pos++;
			}
			else
			{
				return 'text/html';
			}
		}
		elseif (substr($this->file->body, $pos, 1) === '?')
		{
			if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false)
			{
				$pos += 2;
			}
			else
			{
				return 'text/html';
			}
		}
		elseif (substr($this->file->body, $pos, 3) === 'rss'
			|| substr($this->file->body, $pos, 7) === 'rdf:RDF')
		{
			return 'application/rss+xml';
		}
		elseif (substr($this->file->body, $pos, 4) === 'feed')
		{
			return 'application/atom+xml';
		}
		else
		{
			return 'text/html';
		}
	}

	return 'text/html';
}