Skip to content

Checkbox field

Loïc Antignac edited this page May 24, 2022 · 4 revisions

image

Checkbox field only requests the following informations:

[
	'slug'   => 'free_wifi',
	'type'   => 'checkbox',
	'labels' => [
		'label' => 'free_wifi_label',
		'help'  => 'free_wifi_help',
	],
],

The labels key contains the keys for retrieving the labels from the labels array at the root of the entity declaration. Eg:

$declarations[] = [
	'entity'   => 'Webaxones\Core\Option\SettingGroup',
		'labels'   => [
			'free_wifi_label'    => __( 'Free wifi?', 'webaxones-content' ),
			'free_wifi_help'     => __( 'Free wifi on site?', 'webaxones-content' ),
		],