Search code examples
visual-composer

How to set multi default value in type checkbox Visual Composer shortcode?


I have code multi checkbox here:

array(
        "type"        => "checkbox",
        "heading"     => esc_html__( 'Theme Data', 'my-theme' ),
        "param_name"  => "pr_name",
        "admin_label" => true,
        "value"       => array(
            esc_html__( 'Department', 'my-theme' ) => 'department',
            esc_html__( 'Salarry', 'my-theme' ) => 'salarry',
            esc_html__( 'Address', 'my-theme' ) => 'address',
            esc_html__( 'Degree', 'my-theme' ) => 'degree',
            esc_html__( 'Work time', 'my-theme' ) => 'time',
            esc_html__( 'End time', 'my-theme' ) => 'enddate'
        ),
        'std' => array('department', 'salarry'),
    );

Yes, this code not working. How to checked value default is: department and salarry ?

Where is wrong? Please help me.


Solution

  • you can just use 'department,salarry' as the value of the 'std' key.

    'std' => 'department,salarry',