1

I am developing Visual Composer Addons and stuck in an issue. I am using Nested Shortcodes

I want to use param from parent element as a dependency of param of child element. Example : If user selects theme-one in parent element than show primary-color field in child element. Is it possible?

Please let me know if I was not clear.

Any help would be appreciated. Thanks in advance. Happy coding.!!

hussain nayani
  • 317
  • 1
  • 3
  • 14

1 Answers1

1
array(
    'type'        => 'dropdown',
    'heading'     => esc_html__('Box type', 'cursornt' ),
    'param_name'  => 'box',
    'description' => esc_html__('You can select icon size', 'cursornt' ),
    'value'       => array(
        esc_html__('Select position',   'cursornt' )    => '',
        esc_html__('Default',       'cursornt' )    => '1',
        esc_html__('Bordered Box',  'cursornt' )    => '2',
        esc_html__('Bordered Box - Fullwidth',  'cursornt' )    => '3',
        esc_html__('Image Box - Fullwidth',  'cursornt' )   => '4',
    ),
),

array(
    'type'          => 'attach_image',
    'heading'       => esc_html__('BG image', 'cursornt'),
    'param_name'    => 'bgimg',
    'description'   => esc_html__('Add your background image icon', 'cursornt'),
    'dependency'    => array(
        'element'   => 'box',
        'value'     => '4'
    ),
),

check number 4 and it is very easy, if you select Box type "Image Box" then it will show BG image

Mukesh Panchal
  • 1,956
  • 2
  • 18
  • 31
NineTheme
  • 21
  • 2