SimplePie_Item::get_description

Advertisement

Summery Summery

Get the content for the item

Syntax Syntax

SimplePie_Item::get_description( boolean $description_only = false )

Description Description

Prefers summaries over full content , but will return full content if a summary does not exist.

To prefer full content instead, use get_content

Uses <atom:summary>, <description>, <dc:description> or <itunes:subtitle>

Parameters Parameters

$description_only

(Optional) Should we avoid falling back to the content?

Default value: false

Return Return

(string|null)

Source Source

File: wp-includes/SimplePie/Item.php

		        ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML)))
		{
			return $return;
		}

		elseif (!$description_only)
		{
			return $this->get_content(true);
		}

		return null;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
0.8 Introduced.

Advertisement

Leave a Reply