Last active
March 24, 2020 09:02
-
-
Save blogjunkie/68e603d5f0a269f13e5d3b9c19dc7248 to your computer and use it in GitHub Desktop.
Define defaults for Beaver Builder button module Link: https://pro.wpbeaverworld.com/add-default-colors-button-module/
This file contains hidden or 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
<?php | |
add_filter( 'fl_builder_settings_form_defaults', 'wpbw_default_color_button_module', 20, 2 ); | |
function wpbw_default_color_button_module( $defaults, $type ) | |
{ | |
if( $type == "button-module" ) | |
{ | |
$defaults->bg_color = "f59120"; | |
$defaults->bg_hover_color = "808080"; | |
$defaults->text_color = "ffffff"; | |
$defaults->text_hover_color = "ffffff"; | |
//* Border Settings | |
$defaults->border = [ | |
'style' => "solid", | |
'color' => "f59120", | |
'width' => [ | |
'top' => '1', | |
'right' => '1', | |
'bottom' => '1', | |
'left' => '1' | |
] | |
]; | |
$defaults->border_medium = [ | |
'style' => "solid", | |
'color' => "f59120", | |
'width' => [ | |
'top' => '1', | |
'right' => '1', | |
'bottom' => '1', | |
'left' => '1' | |
] | |
]; | |
$defaults->border_responsive = [ | |
'style' => "solid", | |
'color' => "f59120", | |
'width' => [ | |
'top' => '1', | |
'right' => '1', | |
'bottom' => '1', | |
'left' => '1' | |
] | |
]; | |
$defaults->border_hover_color = "808080"; | |
} | |
return $defaults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment