SimplePie::get_channel_tags()publicWP 1.0

Get data for an channel-level element

This method allows you to get access to ANY element/attribute in the channel/header section of the feed.

See SimplePie::get_feed_tags() for a description of the return value

Метод класса: SimplePie{}

Хуков нет.

Возвращает

Массив.

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

$SimplePie = new SimplePie();
$SimplePie->get_channel_tags( $namespace, $tag );
$namespace(строка) (обязательный)
The URL of the XML namespace of the elements you're trying to access
$tag(строка) (обязательный)
Tag name

Заметки

Список изменений

С версии 1.0 Введена.

Код SimplePie::get_channel_tags() WP 6.5.2

public function get_channel_tags($namespace, $tag)
{
	$type = $this->get_type();
	if ($type & SIMPLEPIE_TYPE_ATOM_ALL)
	{
		if ($return = $this->get_feed_tags($namespace, $tag))
		{
			return $return;
		}
	}
	if ($type & SIMPLEPIE_TYPE_RSS_10)
	{
		if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel'))
		{
			if (isset($channel[0]['child'][$namespace][$tag]))
			{
				return $channel[0]['child'][$namespace][$tag];
			}
		}
	}
	if ($type & SIMPLEPIE_TYPE_RSS_090)
	{
		if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel'))
		{
			if (isset($channel[0]['child'][$namespace][$tag]))
			{
				return $channel[0]['child'][$namespace][$tag];
			}
		}
	}
	if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
	{
		if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))
		{
			if (isset($channel[0]['child'][$namespace][$tag]))
			{
				return $channel[0]['child'][$namespace][$tag];
			}
		}
	}
	return null;
}