acf_field_true_false::initializepublicACF 5.0.0

This function will setup the field type data

Method of the class: acf_field_true_false{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

Changelog

Since 5.0.0 Introduced.

acf_field_true_false::initialize() code ACF 6.8.8

function initialize() {

	// vars
	$this->name          = 'true_false';
	$this->label         = __( 'True / False', 'acf' );
	$this->category      = 'choice';
	$this->description   = __( 'A toggle that allows you to pick a value of 1 or 0 (on or off, true or false, etc). Can be presented as a stylized switch or checkbox.', 'acf' );
	$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-true-false.png';
	$this->doc_url       = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/true-false/', 'docs', 'field-type-selection' );
	$this->defaults      = array(
		'default_value' => 0,
		'message'       => '',
		'ui'            => 0,
		'ui_on_text'    => '',
		'ui_off_text'   => '',
	);
}