Last active
December 29, 2019 01:32
-
-
Save jaybuys/4fea9739288d3d3dc004 to your computer and use it in GitHub Desktop.
WordPress Visual Composer Mods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saved me a lot of hunting, cheers Jaybuys.