WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

SimplePie::get_items() public WP 2

Get all items from the feed

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

Это метод класса: SimplePie{}

Хуков нет.

Возвращает

SimplePie_Item[]/null. List of SimplePie_Item{} objects

Использование

$SimplePie = new SimplePie();
$SimplePie->get_items( $start, $end );
$start(число)
Index to start at
По умолчанию: 0
$end(число)
Number of items to return. 0 for all items after $start
По умолчанию: 0

Заметки

  • Смотрите: get_item_quantity

Список изменений

С версии 2 Введена.

Since Beta 2

Код SimplePie::get_items() WP 5.5.1

wp-includes/class-simplepie.php
<?php
public function get_items($start = 0, $end = 0)
{
	if (!isset($this->data['items']))
	{
		if (!empty($this->multifeed_objects))
		{
			$this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);
			if (empty($this->data['items']))
			{
				return array();
			}
			return $this->data['items'];
		}
		$this->data['items'] = array();
		if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
		{
			$keys = array_keys($items);
			foreach ($keys as $key)
			{
				$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
			}
		}
		if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
		{
			$keys = array_keys($items);
			foreach ($keys as $key)
			{
				$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
			}
		}
		if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
		{
			$keys = array_keys($items);
			foreach ($keys as $key)
			{
				$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
			}
		}
		if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
		{
			$keys = array_keys($items);
			foreach ($keys as $key)
			{
				$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
			}
		}
		if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item'))
		{
			$keys = array_keys($items);
			foreach ($keys as $key)
			{
				$this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
			}
		}
	}

	if (empty($this->data['items']))
	{
		return array();
	}

	if ($this->order_by_date)
	{
		if (!isset($this->data['ordered_items']))
		{
			$this->data['ordered_items'] = $this->data['items'];
			usort($this->data['ordered_items'], array(get_class($this), 'sort_items'));
	 	}
		$items = $this->data['ordered_items'];
	}
	else
	{
		$items = $this->data['items'];
	}
	// Slice the data as desired
	if ($end === 0)
	{
		return array_slice($items, $start);
	}

	return array_slice($items, $start, $end);
}