Skip to content

Instantly share code, notes, and snippets.

@mahfuzul
Last active July 20, 2023 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahfuzul/68b88667588e12075361b6cd7d3fc0a9 to your computer and use it in GitHub Desktop.
Save mahfuzul/68b88667588e12075361b6cd7d3fc0a9 to your computer and use it in GitHub Desktop.
Visual Composer field dependency variations
<?php
#Visual Composer field dependency examples:
array(
"type" => "attach_image",
"holder" => "div",
"param_name" => "section_title_image",
"dependency" => [
"element" => "title_type",
"value" => ["image"]
],
),
'dependency' => array(
'element' => 'source',
'value' => 'external_link',
),
'dependency' => array(
'element' => 'source',
'value' => array(
'media_library',
'featured_image',
),
),
'dependency' => array(
'element' => 'stroke_width',
'value_not_equal_to' => '0',
)
'dependency' => array(
'element' => 'use_theme_fonts',
'value_not_equal_to' => 'yes',
),
'dependency' => array(
'element' => 'source',
'is_empty' => true,
),
'dependency' => array(
'element' => 'background_style',
'not_empty' => true,
),
'dependency' => array(
'element' => 'href',
'not_empty' => true,
'callback' => 'vc_cta_button_param_target_callback',
),
'dependency' => array(
'element' => 'post_type',
'value_not_equal_to' => array(
'ids',
'custom',
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment