| 1 |
<?php |
| 2 |
/** |
| 3 |
* Add customizer styles to <head> |
| 4 |
*/ |
| 5 |
function mphb_divi_customizer_css(){ |
| 6 |
|
| 7 |
$button_text_size = absint( et_get_option( 'all_buttons_font_size', '20' ) ); |
| 8 |
$button_text_color = et_get_option( 'all_buttons_text_color', '#ffffff' ); |
| 9 |
$button_bg_color = et_get_option( 'all_buttons_bg_color', 'rgba(0,0,0,0)' ); |
| 10 |
$button_border_width = absint( et_get_option( 'all_buttons_border_width', '2' ) ); |
| 11 |
$button_border_color = et_get_option( 'all_buttons_border_color', '#ffffff' ); |
| 12 |
$button_border_radius = absint( et_get_option( 'all_buttons_border_radius', '3' ) ); |
| 13 |
$button_text_style = et_get_option( 'all_buttons_font_style', '', '', true ); |
| 14 |
$button_spacing = intval( et_get_option( 'all_buttons_spacing', '0' ) ); |
| 15 |
$button_text_color_hover = et_get_option( 'all_buttons_text_color_hover', '#ffffff' ); |
| 16 |
$button_bg_color_hover = et_get_option( 'all_buttons_bg_color_hover', 'rgba(255,255,255,0.2)' ); |
| 17 |
$button_border_color_hover = et_get_option( 'all_buttons_border_color_hover', 'rgba(0,0,0,0)' ); |
| 18 |
$button_border_radius_hover = absint( et_get_option( 'all_buttons_border_radius_hover', '3' ) ); |
| 19 |
$button_spacing_hover = intval( et_get_option( 'all_buttons_spacing_hover', '0' ) ); |
| 20 |
|
| 21 |
?> |
| 22 |
|
| 23 |
<style id="mphb-divi-customizer-css"> |
| 24 |
.mphb_sc_rooms-wrapper .button, |
| 25 |
.mphb_sc_search-wrapper .button, |
| 26 |
.mphb_sc_search_results-wrapper .button, |
| 27 |
.mphb_sc_checkout-wrapper .button, |
| 28 |
.mphb_sc_room-wrapper .button, |
| 29 |
.mphb_sc_booking_form-wrapper .button, |
| 30 |
.widget_mphb_rooms_widget .button, |
| 31 |
.widget_mphb_search_availability_widget form .button, |
| 32 |
.mphb-booking-form .button{ |
| 33 |
<?php |
| 34 |
if(20 !== $button_text_size): |
| 35 |
?> |
| 36 |
font-size: <?php echo $button_text_size;?>px; |
| 37 |
<?php |
| 38 |
endif; |
| 39 |
if('#ffffff' !== $button_text_color): |
| 40 |
?> |
| 41 |
color: <?php echo $button_text_color;?>; |
| 42 |
<?php |
| 43 |
endif; |
| 44 |
if('rgba(0,0,0,0)' !== $button_bg_color): |
| 45 |
?> |
| 46 |
background: <?php echo $button_bg_color;?>; |
| 47 |
<?php |
| 48 |
endif; |
| 49 |
if(2 !== $button_border_width): |
| 50 |
?> |
| 51 |
border-width: <?php echo $button_border_width;?>px !important; |
| 52 |
<?php |
| 53 |
endif; |
| 54 |
if('#ffffff' !== $button_border_color): |
| 55 |
?> |
| 56 |
border-color: <?php echo $button_border_color;?>; |
| 57 |
<?php |
| 58 |
endif; |
| 59 |
if(3 !== $button_border_radius): |
| 60 |
?> |
| 61 |
border-radius: <?php echo $button_border_radius;?>px; |
| 62 |
<?php |
| 63 |
endif; |
| 64 |
if($button_text_style !== ''): |
| 65 |
?> |
| 66 |
<?php echo esc_html( et_pb_print_font_style($button_text_style));?>; |
| 67 |
<?php |
| 68 |
endif; |
| 69 |
if(0 !== $button_spacing): |
| 70 |
?> |
| 71 |
letter-spacing: <?php echo $button_spacing;?>px; |
| 72 |
<?php |
| 73 |
endif; |
| 74 |
if(et_pb_get_specific_default_font( et_get_option( 'all_buttons_font', 'none' ) ) != 'none'): |
| 75 |
?> |
| 76 |
font-family: <?php echo sanitize_text_field(et_pb_get_specific_default_font( et_get_option( 'all_buttons_font', 'none' ) ));?>, sans-serif; |
| 77 |
<?php |
| 78 |
endif; |
| 79 |
?> |
| 80 |
} |
| 81 |
.mphb_sc_rooms-wrapper .button:hover, |
| 82 |
.mphb_sc_search-wrapper .button:hover, |
| 83 |
.mphb_sc_search_results-wrapper .button:hover, |
| 84 |
.mphb_sc_checkout-wrapper .button:hover, |
| 85 |
.mphb_sc_room-wrapper .button:hover, |
| 86 |
.mphb_sc_booking_form-wrapper .button:hover, |
| 87 |
.widget_mphb_rooms_widget .button:hover, |
| 88 |
.widget_mphb_search_availability_widget form .button:hover, |
| 89 |
.mphb-booking-form .button:hover{ |
| 90 |
<?php |
| 91 |
if('#ffffff' !== $button_text_color_hover): |
| 92 |
?> |
| 93 |
color: <?php echo $button_text_color_hover;?> !important; |
| 94 |
<?php |
| 95 |
endif; |
| 96 |
if('rgba(255,255,255,0.2)' !== $button_bg_color_hover): |
| 97 |
?> |
| 98 |
background: <?php echo $button_bg_color_hover;?> !important; |
| 99 |
<?php |
| 100 |
endif; |
| 101 |
if('rgba(0,0,0,0)' !== $button_border_color_hover): |
| 102 |
?> |
| 103 |
border-color: <?php echo $button_border_color_hover;?> !important; |
| 104 |
<?php |
| 105 |
endif; |
| 106 |
if(3 !== $button_border_radius_hover): |
| 107 |
?> |
| 108 |
border-radius: <?php echo $button_border_radius_hover;?>px !important; |
| 109 |
<?php |
| 110 |
endif; |
| 111 |
if(0 !== $button_spacing_hover): |
| 112 |
?> |
| 113 |
letter-spacing: <?php echo $button_spacing_hover;?>px !important; |
| 114 |
<?php |
| 115 |
endif; |
| 116 |
?> |
| 117 |
} |
| 118 |
</style> |
| 119 |
|
| 120 |
<?php |
| 121 |
} |
| 122 |
|
| 123 |
add_action('wp_head', 'mphb_divi_customizer_css'); |
| 124 |
|