add_setting( $basename, array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'billow_google_font_sanitization', ) ); $wp_customize->add_control( new Billow_Google_Font_Select_Custom_Control( $wp_customize, $basename, array( 'label' => isset( $labels[$basename] ) ? $labels[$basename] : __( 'Font Family', 'billow' ), 'section' => $section, 'input_attrs' => array( 'font_count' => '20', 'orderby' => 'popular', ), ) ) ); //-- _font_size $wp_customize->add_setting( $basename.'_size', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_size', array( 'label' => isset( $labels[$basename.'_size'] ) ? $labels[$basename.'_size'] : __( 'Font Size', 'billow' ), 'section' => $section, 'type' => 'text', 'description' => __( 'Enter value including valid css unit, ex: 24px, 18pt, 1.5em or 1.71rem.', 'billow' ), ) ); //-- _weight $wp_customize->add_setting( $basename.'_weight', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_weight', array( 'label' => isset( $labels[$basename.'_weight'] ) ? $labels[$basename.'_weight'] : __( 'Font Weight', 'billow' ), 'section' => $section, 'type' => 'select', 'choices' => array( 'initial' => 'initial', 'inherit' => 'inherit', 'normal' => 'normal', 'bolder' => 'bolder', 'lighter' => 'lighter', '100' => '100', '200' => '200', '300' => '300', '400' => '400', '500' => '500', '600' => '600', '700' => '700', '800' => '800', '900' => '900', ) ) ); //-- _line_height $wp_customize->add_setting( $basename.'_line_height', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_line_height', array( 'label' => isset( $labels[$basename.'_line_height'] ) ? $labels[$basename.'_line_height'] : __( 'Line Height', 'billow' ), 'section' => $section, 'type' => 'text', 'description' => __( 'Enter value including valid css unit, ex: 24px, 18pt, 1.5em, 1.71rem, 1.5 or 150%.', 'billow' ), ) ); //-- _letter_spacing $wp_customize->add_setting( $basename.'_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_letter_spacing', array( 'label' => isset( $labels[$basename.'_letter_spacing'] ) ? $labels[$basename.'_letter_spacing'] : __( 'Letter Spacing', 'billow' ), 'section' => $section, 'type' => 'text', 'description' => __( 'Enter value including valid css unit, ex: 24px, 18pt, 1.5em or 1.71rem.', 'billow' ), ) ); //-- _text_transform $wp_customize->add_setting( $basename.'_text_transform', array( 'default' => '', 'sanitize_callback' => 'billow_text_sanitization', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_text_transform', array( 'label' => isset( $labels[$basename.'_text_transform'] ) ? $labels[$basename.'_text_transform'] : __( 'Text Transform', 'billow' ), 'type' => 'select', 'section' => $section, 'choices' => array( 'capitalize' => 'capitalize', 'lowercase' => 'lowercase', 'uppercase' => 'uppercase', 'none' => 'none', 'inherit' => 'inherit', ) ) ); } /** * Padding */ function billow_customizer_add_padding( $wp_customize, $basename, $section, $labels=array() ){ $wp_customize->add_control( $basename, array( 'label' => isset( $labels[$basename] ) ? $labels[$basename] : __( 'Padding', 'billow' ), 'description' => __( 'Customize the padding. Enter value including valid CSS unit, ex: 25px, 10% or 1em.', 'billow' ), 'section' => $section, 'settings' => array(), 'type' => 'hidden' ) ); //-- _top $wp_customize->add_setting( $basename.'_top', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_top', array( 'label' => isset( $labels[$basename.'_top'] ) ? $labels[$basename.'_top'] :__( 'Top', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _bottom $wp_customize->add_setting( $basename.'_bottom', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_bottom', array( 'label' => isset( $labels[$basename.'_bottom'] ) ? $labels[$basename.'_bottom'] :__( 'Bottom', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _left $wp_customize->add_setting( $basename.'_left', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_left', array( 'label' => isset( $labels[$basename.'_left'] ) ? $labels[$basename.'_left'] :__( 'Left', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _right $wp_customize->add_setting( $basename.'_right', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_right', array( 'label' => isset( $labels[$basename.'_right'] ) ? $labels[$basename.'_right'] :__( 'Right', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); } /** * Border */ function billow_customizer_add_border( $wp_customize, $basename, $section, $labels=array() ){ //-- _border $wp_customize->add_setting( $basename, array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename, array( 'label' => isset( $labels[$basename] ) ? $labels[$basename] : __( 'Border Width', 'billow' ), 'section' => $section, 'type' => 'text', 'description' => __( 'Enter value including valid css unit, ex: 24px, 18pt, 1.5em or 1.71rem.', 'billow' ), ) ); //-- _style $wp_customize->add_setting( $basename.'_style', array( 'default' => 'solid', 'sanitize_callback' => 'billow_text_sanitization', 'transport' => 'refresh', ) ); $wp_customize->add_control( $basename.'_style', array( 'label' => isset( $labels[$basename.'_style'] ) ? $labels[$basename.'_style'] : __( 'Border Style', 'billow' ), 'type' => 'select', 'section' => $section, 'choices' => array( 'solid' => 'solid', 'none' => 'none', 'dotted' => 'dotted', 'dashed' => 'dashed', 'double' => 'double', 'groove' => 'groove', 'ridge' => 'ridge', 'inset' => 'inset', 'outset' => 'outset', 'initial' => 'initial', 'inherit' => 'inherit', ) ) ); //-- _color $wp_customize->add_setting( $basename.'_color', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_alpha', 'sanitize_js_callback' => 'billow_sanitize_js_alpha', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customize_Alpha_Color_Control( $wp_customize, $basename.'_color', array( 'label' => isset( $labels[$basename.'_color'] ) ? $labels[$basename.'_color'] : __( 'Border Color', 'billow' ), 'section' => $section, ) ) ); } /** * Radius */ function billow_customizer_add_radius( $wp_customize, $basename, $section, $labels=array() ){ $wp_customize->add_control( $basename, array( 'label' => isset( $labels[$basename] ) ? $labels[$basename] : __( 'Radius', 'billow' ), 'description' => __( 'Customize the radius. Enter value including valid css unit, ex: 25px, 10% or 1em.', 'billow' ), 'section' => $section, 'settings' => array(), 'type' => 'hidden' ) ); //-- _top_left $wp_customize->add_setting( $basename.'_top_left', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_top_left', array( 'label' => isset( $labels[$basename.'_top_left'] ) ? $labels[$basename.'_top_left'] : __( 'Top Left', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _top_right $wp_customize->add_setting( $basename.'_top_right', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_top_right', array( 'label' => isset( $labels[$basename.'_top_right'] ) ? $labels[$basename.'_top_right'] : __( 'Top Right', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _bottom_left $wp_customize->add_setting( $basename.'_bottom_left', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_bottom_left', array( 'label' => isset( $labels[$basename.'_bottom_left'] ) ? $labels[$basename.'_bottom_left'] : __( 'Bottom Left', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); //-- _bottom_right $wp_customize->add_setting( $basename.'_bottom_right', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh', ) ); $wp_customize->add_control( new Billow_Customizer_CSS_Number_With_Units_Control( $wp_customize, $basename.'_bottom_right', array( 'label' => isset( $labels[$basename.'_bottom_right'] ) ? $labels[$basename.'_bottom_right'] : __( 'Bottom Right', 'billow' ), 'section' => $section, 'type' => 'text', ) ) ); } /** * Shadow */ function billow_customizer_add_shadow( $wp_customize, $basename, $section, $labels=array() ){ //-- _shadow_color $wp_customize->add_setting( $basename.'_shadow_color', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_alpha', 'sanitize_js_callback' => 'billow_sanitize_js_alpha', 'transport' => 'refresh' ) ); $wp_customize->add_control( new Billow_Customize_Alpha_Color_Control( $wp_customize, $basename.'_shadow_color', array( 'label' => isset( $labels[$basename.'_shadow_color'] ) ? $labels[$basename.'_shadow_color'] : __( 'Shadow Color', 'billow' ), 'section' => $section, 'show_opacity' => true, ) ) ); //-- _shadow_x $wp_customize->add_setting( $basename.'_shadow_x', array( 'default' => 0, 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh' ) ); $wp_customize->add_control( new Billow_Slider_Custom_Control( $wp_customize, $basename.'_shadow_x', array( 'label' => isset( $labels[$basename.'_shadow_x'] ) ? $labels[$basename.'_shadow_x'] : __( 'Horizontal Position', 'billow' ), 'section' => $section, 'input_attrs' => array( 'min' => -50, 'max' => 50, 'step' => 1, ), ) ) ); //-- _shadow_y $wp_customize->add_setting( $basename.'_shadow_y', array( 'default' => 0, 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh' ) ); $wp_customize->add_control( new Billow_Slider_Custom_Control( $wp_customize, $basename.'_shadow_y', array( 'label' => isset( $labels[$basename.'_shadow_y'] ) ? $labels[$basename.'_shadow_y'] : __( 'Vertical Position', 'billow' ), 'section' => $section, 'input_attrs' => array( 'min' => -50, 'max' => 50, 'step' => 1, ), ) ) ); //-- _shadow_blur $wp_customize->add_setting( $basename.'_shadow_blur', array( 'default' => '', 'sanitize_callback' => 'billow_sanitize_css_unit', 'sanitize_js_callback' => 'billow_sanitize_js_css_unit', 'transport' => 'refresh' ) ); $wp_customize->add_control( new Billow_Slider_Custom_Control( $wp_customize, $basename.'_shadow_blur', array( 'label' => isset( $labels[$basename.'_shadow_blur'] ) ? $labels[$basename.'_shadow_blur'] : __( 'Shadow Blur', 'billow' ), 'section' => $section, 'input_attrs' => array( 'min' => 0, 'max' => 100, 'step' => 1, ), ) ) ); }