SimplePie::get_item_quantity()publicWP 1.0

Get the number of items in the feed

This is well-suited for for() loops with {@see get_item()}

Method of the class: SimplePie{}

No Hooks.

Return

Int. Number of items in the feed

Usage

$SimplePie = new SimplePie();
$SimplePie->get_item_quantity( $max );
$max(int)
Maximum value to return. 0 for no limit

SimplePie::get_item_quantity() code WP 6.4.3

public function get_item_quantity($max = 0)
{
	$max = (int) $max;
	$qty = count($this->get_items());
	if ($max === 0)
	{
		return $qty;
	}

	return ($qty > $max) ? $max : $qty;
}