PHP Класс Carbon_Fields\Field\Map_Field

Allows to manually select a pin, or to position a pin based on a specified address. Coords (lat, lng), address and zoom are saved in the database.
Наследование: extends Field
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$address string Current address.
$default_lat float Default latitude.
$default_lng float Default longitude.
$default_zoom integer Default zoom.
$lat float | string Current latitude.
$lazyload boolean Whether to lazy load this field.
$lng float | string Current longitude.
$zoom integer Current zoom.

Открытые методы

Метод Описание
admin_enqueue_scripts ( ) Enqueue scripts in the administration
load ( ) Load data from the datastore.
save ( ) Save data to the datastore.
set_position ( string $lat, string $lng, integer $zoom ) Set the coords and zoom of this field.
set_value_from_input ( array $input = null ) Load the field value from an input array based on it's name
template ( ) Underscore template of this field.
to_json ( boolean $load ) : array Returns an array that holds the field data, suitable for JSON representation.

Описание методов

admin_enqueue_scripts() публичный статический Метод

Enqueue scripts in the administration
public static admin_enqueue_scripts ( )

load() публичный Метод

Manually set the map field data fragments.
public load ( )

save() публичный Метод

Manually save the map field data fragments.
public save ( )

set_position() публичный Метод

Set the coords and zoom of this field.
public set_position ( string $lat, string $lng, integer $zoom )
$lat string Latitude
$lng string Longitude
$zoom integer Zoom level

set_value_from_input() публичный Метод

Load the field value from an input array based on it's name
public set_value_from_input ( array $input = null )
$input array (optional) Array of field names and values. Defaults to $_POST

template() публичный Метод

Underscore template of this field.
public template ( )

to_json() публичный Метод

This data will be available in the Underscore template and the Backbone Model.
public to_json ( boolean $load ) : array
$load boolean Should the value be loaded from the database or use the value from the current instance.
Результат array

Описание свойств

$address защищенное свойство

Current address.
protected string $address
Результат string

$default_lat защищенное свойство

Default latitude.
protected float $default_lat
Результат float

$default_lng защищенное свойство

Default longitude.
protected float $default_lng
Результат float

$default_zoom защищенное свойство

Default zoom.
protected int $default_zoom
Результат integer

$lat защищенное свойство

Current latitude.
protected float|string $lat
Результат float | string

$lazyload защищенное свойство

Whether to lazy load this field.
protected bool $lazyload
Результат boolean

$lng защищенное свойство

Current longitude.
protected float|string $lng
Результат float | string

$zoom защищенное свойство

Current zoom.
protected int $zoom
Результат integer