简体   繁体   中英

How to make wordpress visual composer attribute check box checked initially

according to visual composer knowledge base we can add attribute like

vc_map( array(
    "name"          => __("Portfolio Grid", "js_composer"),
    "base"          => "abc-portfolio",
    "description"   => __("Display masonry portfolio grid", "js_composer"),
    "class"         => "abc-portfolio-section",
    "category"      => __("abc Component", "js_composer"),
    "params"        => array( 
        array(
            "type"          => "checkbox",
            "admin_label"   => true,
            "weight"        => 10,
            "heading"       => __( "Make featured", "js_composer" ),
            "description"   => __("description", "js_composer"),
            "value"         => array('key'   => 'value' ),
            "param_name"    => "abc_param"
        ),
    )
) );

Here we get a check-box but how can I make this check-box checked initially ?

thanks in advance.

Check the Custom checkbox attribute .

Actually, configuration is possible by array key:

'std' => '', // default unchecked

So you can play with this attribute std with values true/false/'yes'.. and you will see how it changes.

In your case:

"value" => array('key' => 'value' ),

So if 'std'=>'value' your checkbox will be checked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM