1

How do I get the settings to the frontend? I need to add classes to vc_row.

enter image description here

/** * Ken Burns Effect for Row. */

add_action( 'vc_after_init', 'ken_burns_effect_add_option_to_vc_row' );

function ken_burns_effect_add_option_to_vc_row() {
    // Ken Burns Effect Attributes
    $ken_burns_effect_attributes = 
    array(
        array(
            'type' => 'checkbox',
            'heading' => __( 'Ken Burns for image background', 'ken_burns_effect' ),
            'param_name' => 'enable_ken_burns_effect',
            'value' => array(
                __( 'Yes', 'ken_burns_effect' ) => 'yes',
            ),
            'description' => 'Check this box if you want to enable ken burns effect for this row.',
        ),
        array(
            'type' => 'dropdown',
            'heading' => __( 'Direction', 'ken_burns_effect' ),
            'param_name' => 'direction_ken_burns_effect',
            'value' => array(
                'Zoom In' => 'zoom_in',
                'Zoom Out' => 'zoom_out',
            ),
            'description' => __( '', 'ken_burns_effect' ),
            'dependency' => array(
                'element' => 'enable_ken_burns_effect',
                'value' => array( 'yes' ),
            ),
        ), 
        array(
            'type' => 'textfield',
            'heading' => __( 'Transition speed', 'ken_burns_effect' ),
            'param_name' => 'transition_speed_ken_burns_effect',
            'value' => '',
            'description' => __( '', 'ken_burns_effect' ),
            'dependency' => array(
                'element' => 'enable_ken_burns_effect',
                'value' => array( 'yes' ),
            ),
        ),
    );
    vc_add_params( 'vc_row', $ken_burns_effect_attributes);
}
wasterel
  • 43
  • 5

1 Answers1

0

You will have to override the vc_row.php by copying it to your theme or plugin. You can check their documentation on how to set the override directory: https://kb.wpbakery.com/docs/inner-api/vc_set_shortcodes_templates_dir/

Then you can use your custom params inside vc_row.php using their param_name eg:

$enable_ken_burns_effect;
$direction_ken_burns_effect;
$transition_speed_ken_burns_effect;

Keep in mind that you have to override vc_row_inner.php too if you want to use options there. Same goes for section and columns.

Muhammad Zohaib
  • 307
  • 1
  • 5
  • 15