The "select" control

Learn how to create controls using Kirki

Back to Controls

Returnsstring|int

The documentation site is currently being rewritten. If you can't find what you're looking for please check the github issues and ask for assistance there until the documentation rewrite is complete.

Example

Kirki::add_field( 'theme_config_id', array(
	'type'        => 'select',
	'settings'    => 'my_setting',
	'label'       => __( 'This is the label', 'textdomain' ),
	'section'     => 'section_id',
	'default'     => 'option-1',
	'priority'    => 10,
	'multiple'    => 1,
	'choices'     => array(
		'option-1' => esc_attr__( 'Option 1', 'textdomain' ),
		'option-2' => esc_attr__( 'Option 2', 'textdomain' ),
		'option-3' => esc_attr__( 'Option 3', 'textdomain' ),
		'option-4' => esc_attr__( 'Option 4', 'textdomain' ),
	),
) );
Edit this page