Skip to main content

vc_shortcode_prepare_atts

Filters the prepared shortcode attributes after they have been processed and sanitized by WPBakery Page Builder.

Parameters

ParameterTypeDescription
$attributesarrayThe prepared and sanitized shortcode attributes.
$shortcodestringThe shortcode tag name.
$settingsarrayThe shortcode settings as registered via vc_map().

Usage

<?php
add_filter( 'vc_shortcode_prepare_atts', 'my_modify_shortcode_atts', 10, 3 );

function my_modify_shortcode_atts( $attributes, $shortcode, $settings ) {
// Add a default value for a custom attribute on a specific element.
if ( 'vc_column_text' === $shortcode && empty( $attributes['css_animation'] ) ) {
$attributes['css_animation'] = 'fadeIn';
}

return $attributes;
}

Source

File: include/classes/shortcodes/core/class-wpbakeryshortcode.php