Radio Field Join KC discussion

This field creates a list of tickable options. It is used when you want one option is to be selected at a time.

Notice: This field requires the 'options' parameter.

KingComposer field radio

Map Usage:

array(
	'name' => 'field_id',
	'label' => 'Field Label',

	'type' => 'radio',  // USAGE RADIO TYPE
	'options' => array(    // REQUIRED
		'option_1' => 'The Label 1',
		'option_2' => 'The Label 2',
		'option_3' => 'The Label 3',
	),

	'value' => 'DEFAULT-CONTENT', // remove this if you do not need a default content 
	'description' => 'Field Description',
)

Example:

Register a new shortcode with filed type: radio

add_map(
	    
        array(
           
            // 1st shortcode element
            'my_shortcode' => array(
                'name' => 'My Shortcode',
                'description' => 'This is my shortcode',
                'icon' => 'my-class-icon',
                'category' => 'Content',
                'params' => array(
                    //1st field
                    array(
                        'name' => 'full_height',
                        'label' => 'Full Height?',
                        'type' => 'radio',
                        'options' => array(
                             'option_1' => 'The Label 1',
		             'option_2' => 'The Label 2',
		             'option_3' => 'The Label 3',
                        )
                    ),
                    //2nd field
                )
            ),

            // 2nd shortcode element

        ) // End Arrays
    );

} // end my_wp_init()
       
?>

Read more