WordPress at a glance
function is not described

SimplePie::merge_items() public WP 1.0

Merge items from several feeds into one

If you're merging multiple feeds together, they need to all have dates for the items or else SimplePie will refuse to sort them.

{} It's a method of the class: SimplePie{}

No Hooks.


Array. Nothing.


$result = SimplePie::merge_items( $urls, $start, $end, $limit );
$urls(array) (required)
List of SimplePie feed objects to merge
Starting item
Number of items to return
Maximum number of items per feed

Code of SimplePie::merge_items() WP 5.7.2

public static function merge_items($urls, $start = 0, $end = 0, $limit = 0)
	if (is_array($urls) && sizeof($urls) > 0)
		$items = array();
		foreach ($urls as $arg)
			if ($arg instanceof SimplePie)
				$items = array_merge($items, $arg->get_items(0, $limit));
				trigger_error('Arguments must be SimplePie objects', E_USER_WARNING);

		usort($items, array(get_class($urls[0]), 'sort_items'));

		if ($end === 0)
			return array_slice($items, $start);

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

	trigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING);
	return array();