WordPress Customizer Radio Image Control

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

Back to Controls

Returnsstring

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',
	],
] );

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