Skip to content

Instantly share code, notes, and snippets.

@jaybuys
Last active December 29, 2019 01:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jaybuys/4fea9739288d3d3dc004 to your computer and use it in GitHub Desktop.
Save jaybuys/4fea9739288d3d3dc004 to your computer and use it in GitHub Desktop.
WordPress Visual Composer Mods
function vc_update_defaults() {
// Default single image to size "full"
$param = WPBMap::getParam( 'vc_single_image', 'img_size' );
$param['value'] = 'full';
vc_update_shortcode_param( 'vc_single_image', $param );
// Modify button 2 styles to use custom colors
$colors_arr = array(
__( 'Custom Color #1', 'js_composer' ) => 'custom_classname_1',
__( 'Custom Color #2', 'js_composer' ) => 'custom_classname_2'
);
$param = WPBMap::getParam( 'vc_button2', 'color' );
$param['value'] = $colors_arr;
vc_update_shortcode_param( 'vc_button2', $param );
}
add_action('init', 'vc_update_defaults', 100); // Visual Composer Defaults
// Remove Button 1. Rename Button 2 to just "Button"
vc_remove_element( "vc_button" );
$vc_button2_settings = array( 'name' => "Button" );
vc_map_update( 'vc_button2', $vc_button2_settings );
@peazz
Copy link

peazz commented Feb 12, 2016

Saved me a lot of hunting, cheers Jaybuys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment