WordPress at a glance
function is not described

SimplePie::get_feed_tags() public WP 1.0

Get data for an feed-level element

This method allows you to get access to ANY element/attribute that is a sub-element of the opening feed tag.

The return value is an indexed array of elements matching the given namespace and tag name. Each element has attribs, data and child subkeys. For attribs and child, these contain namespace subkeys. attribs then has one level of associative name => value data (where value is a string) after the namespace. child has tag-indexed keys after the namespace, each member of which is an indexed array matching this same format.

For example:

// This is probably a bad example because we already support
// <media:content> natively, but it shows you how to parse through
// the nodes.
$group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group');
$content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'];
$file = $content[0]['attribs']['']['url'];
echo $file;

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

No Hooks.




$SimplePie = new SimplePie();
$SimplePie->get_feed_tags( $namespace, $tag );
$namespace(string) (required)
The URL of the XML namespace of the elements you're trying to access
$tag(string) (required)
Tag name



Since 1.0 Introduced.

Code of SimplePie::get_feed_tags() WP 5.7.2

public function get_feed_tags($namespace, $tag)
	$type = $this->get_type();
	if ($type & SIMPLEPIE_TYPE_ATOM_10)
		if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]))
			return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag];
	if ($type & SIMPLEPIE_TYPE_ATOM_03)
		if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]))
			return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag];
		if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]))
			return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag];
		if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))
			return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag];
	return null;