radio-image(sample)

Display a set of radio buttons with image labels.

Option Details & Parameters

Type: radio-image

Returns: string

Can be placed in: Admin Panels , Admin Tabs , Meta Boxes , Theme Customizer

Parameter Type Description
name string The name of the option, for display purposes only.
id string A unique ID for this option. This ID will be used to get the value for this option.
desc string The description to display together with this option.
options array (Optional) An associative array containing value and image url pairs. The image urls will be displayed beside the radio buttons.
default string (Optional) The default value for this option.
livepreview string (Optional) jQuery code that updates something in your site in the live preview. Only used when the option is placed in a theme customizer section. Refer to Livepreview for more information on this parameter.
css string (Optional) CSS rules to be used with this option. Only used when the option is placed in an admin page / panel or a theme customizer section. Refer to Generate CSS Automatically for your options for more information on this parameter.

Examples

Creating an option:

$panel->createOption( array(
'name' => 'Select a Layout',
'id' => 'my_layout',
'type' => 'radio-image',
'options' => array(
'layout1' => get_template_directory_uri() . '/images/radio1.png',
'layout2' => get_template_directory_uri() . '/images/radio2.png',
'layout3' => get_template_directory_uri() . '/images/radio3.png',
'layout4' => get_template_directory_uri() . '/images/radio4.png',
),
'default' => 'layout3',
) );