multiple

The multiple argument is only used in the select controls.

Its value is an integer and defines the number of simultaneous options the user will be able to select.

Defaults to 1.

new \Kirki\Field\Select(
	[
		'settings'    => 'multiselect',
		'label'       => esc_html__( 'Multiselect field', 'kirki' ),
		'description' => esc_html__( 'Select up to 2 values.', 'kirki' ),
		'section'     => 'section_id',
		'default'     => 'option-3',
		'multiple'    => 2,
		'choices'     => [
			'option-1' => esc_html__( 'Option 1', 'kirki' ),
			'option-2' => esc_html__( 'Option 2', 'kirki' ),
			'option-3' => esc_html__( 'Option 3', 'kirki' ),
			'option-4' => esc_html__( 'Option 4', 'kirki' ),
			'option-5' => esc_html__( 'Option 5', 'kirki' ),
		],
	]
);

Not passing the 'multiple' argument, setting it to 1 or false will only allow for 1 selection.

If set to 0 the selection is infinte, meaning the user can choose as many options available.

Was this helpful?