Skip to content

Toggle field

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

image

Toggle field only requests the following informations:

[
	'slug'   => 'swimming_pool',
	'type'   => 'toggle',
	'labels' => [
		'label' => 'swimming_pool_label',
		'help'  => 'swimming_pool_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'   => [
			'swimming_pool_label'    => __( 'Swimming pool?', 'webaxones-content' ),
			'swimming_pool_help'     => __( 'Swimming pool on site?', 'webaxones-content' ),
		],
Clone this wiki locally