WordPress Customizer Radio Buttonset Control

Learn how to create a radio buttonset control using the Kirki Customizer Framework.

Back to Controls

Returnsstring

You can define the available options using the choices argument and formatting them as an array key => label.

Example

Kirki::add_field( 'theme_config_id', [
	'type'        => 'radio-buttonset',
	'settings'    => 'my_setting',
	'label'       => esc_html__( 'Radio-Buttonset Control', 'kirki' ),
	'section'     => 'section_id',
	'default'     => 'red',
	'priority'    => 10,
	'choices'     => [
		'red'   => esc_html__( 'Red', 'kirki' ),
		'green' => esc_html__( 'Green', 'kirki' ),
		'blue'  => esc_html__( 'Blue', 'kirki' ),
	],
] );

Can't find what you're looking for? Check the github issues or edit this page to add what's missing.