SimplePie::get_item()publicWP 2

Get a single item from the feed

This is better suited for for() loops, whereas {@see get_items()} is better suited for foreach() loops.

Method of the class: SimplePie{}

No Hooks.

Return

SimplePie_Item|null.

Usage

$SimplePie = new SimplePie();
$SimplePie->get_item( $key );
$key(int)
The item that you want to return. Remember that arrays begin with 0, not 1

Notes

  • See: get_item_quantity()

Changelog

Since 2 Introduced.
Since Beta 2

SimplePie::get_item() code WP 6.5.2

public function get_item($key = 0)
{
	$items = $this->get_items();
	if (isset($items[$key]))
	{
		return $items[$key];
	}

	return null;
}