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

SimplePie_Item::get_date() public WP 2

Get the posting date/time for the item

Uses <atom:published>, <atom:updated>, <atom:issued>, <atom:modified>, <pubDate> or <dc:date>

Note: obeys PHP's timezone setting. To get a UTC date/time, use {@see get_gmdate}

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

Хуков нет.

Возвращает

Число/Строку/null.

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

$SimplePie_Item = new SimplePie_Item();
$SimplePie_Item->get_date( $date_format );
$date_format(строка)
Supports any PHP date format from date (empty for the raw data)
По умолчанию: 'j F Y, g:i a'

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

С версии 2 Введена.
Since Beta 2 (previously called get_item_date С версии 0.8 )

Код SimplePie_Item::get_date() WP 5.5.3

<?php
public function get_date($date_format = 'j F Y, g:i a')
{
	if (!isset($this->data['date']))
	{
		if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}
		elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))
		{
			$this->data['date']['raw'] = $return[0]['data'];
		}

		if (!empty($this->data['date']['raw']))
		{
			$parser = $this->registry->call('Parse_Date', 'get');
			$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
		}
		else
		{
			$this->data['date'] = null;
		}
	}
	if ($this->data['date'])
	{
		$date_format = (string) $date_format;
		switch ($date_format)
		{
			case '':
				return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);

			case 'U':
				return $this->data['date']['parsed'];

			default:
				return date($date_format, $this->data['date']['parsed']);
		}
	}

	return null;
}