acf_field_checkbox::initializepublicACF 5.0.0

This function will setup the field type data

Метод класса: acf_field_checkbox{}

Хуков нет.

Возвращает

n/a.

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

$acf_field_checkbox = new acf_field_checkbox();
$acf_field_checkbox->initialize();

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

С версии 5.0.0 Введена.

Код acf_field_checkbox::initialize() ACF 6.8.8

function initialize() {

	// vars
	$this->name          = 'checkbox';
	$this->label         = __( 'Checkbox', 'acf' );
	$this->category      = 'choice';
	$this->description   = __( 'A group of checkbox inputs that allow the user to select one, or multiple values that you specify.', 'acf' );
	$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-checkbox.png';
	$this->doc_url       = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/checkbox/', 'docs', 'field-type-selection' );
	$this->defaults      = array(
		'layout'                    => 'vertical',
		'choices'                   => array(),
		'default_value'             => '',
		'allow_custom'              => 0,
		'save_custom'               => 0,
		'toggle'                    => 0,
		'return_format'             => 'value',
		'custom_choice_button_text' => __( 'Add new choice', 'acf' ),
	);
}