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

SimplePie::get_contributors() WP 1.1

Get all contributors for the feed

Uses <atom:contributor>

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

Хуков нет.

Возвращает

Массив/null. List of SimplePie_Author{} objects

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

$SimplePie = new SimplePie();
$var = $SimplePie->get_contributors();

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

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

Код SimplePie::get contributors: wp-includes/class-simplepie.php WP 5.2.2

<?php
public function get_contributors()
{
	$contributors = array();
	foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
	{
		$name = null;
		$uri = null;
		$email = null;
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
		{
			$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
		}
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
		{
			$uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
		}
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
		{
			$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
		}
		if ($name !== null || $email !== null || $uri !== null)
		{
			$contributors[] = $this->registry->create('Author', array($name, $uri, $email));
		}
	}
	foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
	{
		$name = null;
		$url = null;
		$email = null;
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
		{
			$name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
		}
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
		{
			$url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
		}
		if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
		{
			$email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
		}
		if ($name !== null || $email !== null || $url !== null)
		{
			$contributors[] = $this->registry->create('Author', array($name, $url, $email));
		}
	}

	if (!empty($contributors))
	{
		return array_unique($contributors);
	}
	else
	{
		return null;
	}
}