-
-
Save peazz/b444d1e8a343d84c17d2 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('vc_after_init', 'vc_update_defaults', 100); // Updates everywhere, including custom shortcodes | |
// 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