vendredi 16 août 2019

Checkbox vc_map always returning false value even after checked

I'm creating a custom element for the WP Bakery plugin and I have the following checkbox defined:

map.php

array(
    'type' => 'checkbox',
    'heading' => esc_html__( 'Add box shadow?', 'js_composer' ),
    'param_name' => 'add_boxShadow',
    'description' => '',
    'value' => __('Yes'),
    'admin_label' => false,
    'weight' => 0,
),

And I have defined the variable like so:

init.php

extract(
    shortcode_atts(
        array(
            'add_boxShadow' => '',
            // 'add_boxShadow' => false, // have also tried this
        ),
        $atts
    )
);

When I go into the Bakery editor and tick the checkbox, then update the page, when going back to the editor, the checkbox will be unticked? And I'm unsure why?




Aucun commentaire:

Enregistrer un commentaire