get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
$wp_customize->get_control( 'background_color' )->label = esc_html__( 'Background', 'bosa' );
}
add_action( 'bosa_customize_register', 'bosa_modify_default_settings' );
if( !function_exists( 'bosa_hex2rgba' ) ):
/**
* Convert hexdec color string to rgb(a) string
*/
function bosa_hex2rgba($color, $opacity = false) {
$default = 'rgba(0,0,0, 0.1)';
# Return default if no color provided
if( empty( $color ) )
return $default;
# Sanitize $color if "#" is provided
if ( $color[0] == '#' ) {
$color = substr( $color, 1 );
}
# Check if color has 6 or 3 characters and get values
if ( strlen( $color ) == 6 ) {
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
} elseif ( strlen( $color ) == 3 ) {
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
} else {
return $default;
}
# Convert hexadec to rgb
$rgb = array_map('hexdec', $hex);
# Check if opacity is set(rgba or rgb)
if( $opacity ){
if( abs( $opacity ) > 1 )
$opacity = 1.0;
$output = 'rgba('.implode( ",",$rgb ).','.$opacity.')';
} else {
$output = 'rgb('.implode( ",",$rgb ).')';
}
# Return rgb(a) color string
return $output;
}
endif;
function bosa_default_styles(){
// Begin Style
$css = '';
?>