acf_field_select::initialize
Sets up the field type data.
Метод класса: acf_field_select{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_select = new acf_field_select(); $acf_field_select->initialize();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_select::initialize() acf field select::initialize ACF 6.4.2
public function initialize() {
$this->name = 'select';
$this->label = _x( 'Select', 'noun', 'acf' );
$this->category = 'choice';
$this->description = __( 'A dropdown list with a selection of choices that you specify.', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-select.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/select/', 'docs', 'field-type-selection' );
$this->defaults = array(
'multiple' => 0,
'allow_null' => 0,
'choices' => array(),
'default_value' => '',
'ui' => 0,
'ajax' => 0,
'placeholder' => '',
'return_format' => 'value',
'create_options' => 0,
'save_options' => 0,
);
add_action( 'wp_ajax_acf/fields/select/query', array( $this, 'ajax_query' ) );
add_action( 'wp_ajax_nopriv_acf/fields/select/query', array( $this, 'ajax_query' ) );
}