I am creating visual composer plugin for price table. I want to add dynamic textfield so user become able to add multiple text fields for item list as want. For now it's showing only one text field but user should able to add multiple fields.
array (
"type" => "textfield",
"heading" => __( 'List Items', 'pt-vc' ),
"param_name" => "price_list",
"description" => __( 'Write the list item that you offer', 'pt-vc' ),
"group" => 'List Item',
),
You can use param_group. Here is the code example.
'params'=> array (
array(
'type' => 'param_group',
'value' => '',
'heading' => __( 'List Items', 'pt-vc' ),
'param_name' => 'price_list',
// Note params is mapped inside param-group:
'params' => array(
array(
'type' => 'textfield',
'value' => '',
'heading' => __( 'List Items', 'pt-vc' ),
'param_name' => 'list_itmes',
)
)
)
);
I think answer may be late but help others.
You may use param_group for that. It's not mentioned in the documentation but you may find it "How To's" https://kb.wpbakery.com/docs/developers-how-tos/use-param-group-in-elements/
Code snippet from link (in case link expires again):
vc_map(
array(
'base' => 'your_shortcode',
'params' => array(
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Title',
'param_name' => 'simple_textfield',
),
// params group
array(
'type' => 'param_group',
'value' => '',
'param_name' => 'titles',
// Note params is mapped inside param-group:
'params' => array(
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Enter your title(multiple field)',
'param_name' => 'title',
)
)
)
)
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With