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