Number Slider Field Join KC discussion

This field creates a slider which allows you to drag the scrollbar to change the parameter value.

Notice: This field requires the 'options' parameter.

KingComposer field number slider

Map Usage:

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

	'type' => 'number_slider',  // USAGE RADIO TYPE
	'options' => array(    // REQUIRED
		'min' => 0,
		'max' => 200,
		'unit' => 'px',
		'show_input' => true
	),

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

Example:

Register a new shortcode with filed type: number_slider

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' => 'number_post',
                        'label' => 'Number post show',
                        'type' => 'number_slider',
                        'options' => array(
                            'min' => 0,
                            'max' => 200,
                            'unit' => 'px',
                            'show_input' => true
                        ),
                        'description' => 'Display number of post'
                    ),
                    //2nd field
                )
            ),

            // 2nd shortcode element

        ) // End Arrays
    );

} // end my_wp_init()
       
?>

Read more