The "radio-image" control

Learn how to create controls using Kirki

Back to Controls

Returnsstring

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

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

Example

Kirki::add_field( 'theme_config_id', [
	'type'        => 'radio-image',
	'settings'    => 'my_setting',
	'label'       => esc_html__( 'Radio Control', 'kirki' ),
	'section'     => 'section_id',
	'default'     => 'red',
	'priority'    => 10,
	'choices'     => [
		'red'   => get_template_directory_uri() . '/assets/images/red.png',
		'green' => get_template_directory_uri() . '/assets/images/green.png',
		'blue'  => get_template_directory_uri() . '/assets/images/blue.png',
	],
] );
Edit this page