remove_section('jolene_color_scheme'); $wp_customize->remove_control('shadow_color'); $wp_customize->add_setting( 'opacity', array( 'default' => $defaults['opacity'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biker_sanitize_opacity' ) ); $wp_customize->add_control( 'opacity', array( 'label' => __('Opacity for menus and other elements', 'biker'), 'section' => 'colors', 'settings' => 'opacity', 'type' => 'select', 'priority' => 1, 'choices' => array ('0.1' => '0.1', '0.2' => '0.2', '0.3' => '0.3', '0.4' => '0.4', '0.5' => '0.5', '0.6' => '0.6', '0.7' => '0.7', '0.8' => '0.8', '0.9' => '0.9', '1' => '1') ) ); //column widget background $wp_customize->add_setting( 'top', array( 'default' => $defaults['top'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'biker_sanitize_background_position' ) ); $wp_customize->add_control( 'top', array( 'label' => __( 'Vertical position', 'biker' ), 'section' => 'background_image', 'settings' => 'top', 'type' => 'select', 'priority' => 2, 'choices' => array ('top' => __('Top', 'biker'), 'center' => __('Center', 'biker'), 'bottom' => __('Bottom', 'biker')) ) ); $wp_customize->get_setting( 'menu1_color' )->transport = 'refresh'; $wp_customize->get_setting( 'menu2_color' )->transport = 'refresh'; $wp_customize->get_setting( 'menu3_color' )->transport = 'refresh'; $wp_customize->get_setting( 'sidebar1_color' )->transport = 'refresh'; $wp_customize->get_setting( 'sidebar2_color' )->transport = 'refresh'; } add_action( 'customize_register', 'biker_customize_register', 21 ); /** * Sanitize opacity. * * @param string $value Value to sanitize. * @return sanitized value. * @since biker 1.0 */ function biker_sanitize_opacity( $value ) { $possible_values = array ('0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1'); return ( in_array( $value, $possible_values ) ? $value : '0.3' ); } /** * Return string Sanitized backgroind position * * @since biker 1.0 */ function biker_sanitize_background_position( $value ) { $possible_values = array( 'top', 'center', 'bottom'); return ( in_array( $value, $possible_values ) ? $value : 'top' ); } /** * Add custom styles to the header. * * @since biker 1.0 */ function biker_hook_css() { $defaults = jolene_get_defaults(); $def_colors = jolene_get_colors(get_theme_mod('color_scheme', $defaults['color_scheme'])); $top = get_theme_mod('top', $defaults['top']); $opacity = get_theme_mod('opacity', $defaults['opacity']); $opacity = get_theme_mod('opacity', $defaults['opacity']); $min_opacity = ( floatval($opacity) < 0.5 ? 0.5 : floatval($opacity) ); ?>