SimplePie_Item::get_longitude() public WP 1.0
Get the longitude coordinates for the item
Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
Uses <geo:long>, <geo:lon> or <georss:point>
{} Это метод класса: SimplePie_Item{}
Хуков нет.
Возвращает
Строку/null
. Ничего.
Использование
$SimplePie_Item = new SimplePie_Item(); $SimplePie_Item->get_longitude();
Список изменений
С версии 1.0 | Введена. |
Код SimplePie_Item::get_longitude() SimplePie Item::get longitude WP 5.7.1
public function get_longitude()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
{
return (float) $return[0]['data'];
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
{
return (float) $return[0]['data'];
}
elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
{
return (float) $match[2];
}
return null;
}