How to create dynamic fields in visual composer? How to create dynamic fields in visual composer? wordpress wordpress

How to create dynamic fields in visual composer?


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',               )            )         )      )   ))