Skip to content

Instantly share code, notes, and snippets.

@wpexplorer
Created March 7, 2021 22:29
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 wpexplorer/ddfaed79464adf1a3c109f93c9281001 to your computer and use it in GitHub Desktop.
Save wpexplorer/ddfaed79464adf1a3c109f93c9281001 to your computer and use it in GitHub Desktop.
// Set the "animate_onscroll" parameter for all Total vcex_ shortcodes to true by default.
// Note this example filters ALL shortcodes but you can use the $shortcode_tag argument to check
// which shortcode is currently being filtered.
add_filter( 'vcex_shortcode_params', function( $params, $shortcode_tag ) {
foreach ( $params as $key => $val ) {
if ( isset( $val['param_name'] ) && 'animate_onscroll' === $val['param_name'] ) {
$params[$key]['std'] = 'true';
}
}
return $params;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment