SimplePie_Item::get_content

Advertisement

Summery Summery

Get the content for the item

Syntax Syntax

SimplePie_Item::get_content( boolean $content_only = false )

Description Description

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

To prefer summaries instead, use get_description

Uses <atom:content> or <content:encoded> (RSS 1.0 Content Module)

Parameters Parameters

$content_only

(boolean) (Optional) Should we avoid falling back to the description?

Default value: false

Return Return

(string|null)

Source Source

File: wp-includes/SimplePie/Item.php

	{
		if (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) &&
		    ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) &&
		        ($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_MODULES_CONTENT, 'encoded')) &&
		        ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
		{
			return $return;
		}
		elseif (!$content_only)
		{
			return $this->get_description(true);
		}

		return null;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
1.0 Introduced.

Advertisement

Leave a Reply

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