Multiple Field Join KC discussion

The Multiple field creates multiple select inputs, it allows you to select more than one value.

Notice: This field requires the 'options' parameter.

KingComposer field multiple

Map Usage:

array(
	'name' => 'field_id',
	'label' => 'Field Label',
	'type' => 'multiple',  // USAGE MULTIPLE 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: multiple
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' => 'field_id',
                        'label' => 'Field Label',
                        'type' => 'multiple',  // USAGE MULTIPLE 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',
                    ),
                    //2nd field
                )
            ),

            // 2nd shortcode element

        ) // End Arrays
    );

} // end my_wp_init()

?>

Read more