add_panel( 'acoustics_typography_panel', array( 'title' => esc_html__( 'Typography', 'acoustics'), 'priority' => 10, ) ); /*-------------------------------------------- General ---------------------------------------------*/ $wp_customize->add_section( 'acoustics_typography_general', array( 'title' => esc_html__( 'General', 'acoustics'), 'panel' => 'acoustics_typography_panel', ) ); $wp_customize->add_setting( 'acoustics_typography_library', array( 'default' => 'google', 'sanitize_callback' => 'acoustics_sanitize_select', ) ); $wp_customize->add_control( 'acoustics_typography_library', array( 'type' => 'select', 'label' => esc_html__( 'Fonts Library', 'acoustics' ), 'section' => 'acoustics_typography_general', 'choices' => array( 'google' => esc_html__( 'Google Fonts', 'acoustics' ), 'adobe' => esc_html__( 'Adobe Fonts', 'acoustics' ), ) ) ); /*-------------------------------------------- Heading ---------------------------------------------*/ $wp_customize->add_section( 'acoustics_typography_heading', array( 'title' => esc_html__( 'Headings', 'acoustics'), 'panel' => 'acoustics_typography_panel', ) ); $wp_customize->add_setting( 'acoustics_heading_font', array( 'default' => '{"font":"System default","regularweight":"700","category":"sans-serif"}', 'sanitize_callback' => 'acoustics_google_fonts_sanitize', 'transport' => 'postMessage' ) ); $wp_customize->add_control( new Acoustics_Control_Typography( $wp_customize, 'acoustics_heading_font', array( 'section' => 'acoustics_typography_heading', 'settings' => array ( 'family' => 'acoustics_heading_font', ), 'input_attrs' => array( 'font_count' => 'all', 'orderby' => 'alpha', 'disableRegular' => false, ), ) ) ); $wp_customize->add_setting( 'acoustics_heading_font_style', array( 'default' => 'normal', 'sanitize_callback' => 'acoustics_sanitize_select', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'acoustics_heading_font_style', array( 'type' => 'select', 'section' => 'acoustics_typography_heading', 'label' => esc_html__( 'Font style', 'acoustics' ), 'choices' => array( 'normal' => esc_html__( 'Normal', 'acoustics' ), 'italic' => esc_html__( 'Italic', 'acoustics' ), 'oblique' => esc_html__( 'Oblique', 'acoustics' ), ), ) ); $wp_customize->add_setting( 'acoustics_heading_line_height', array( 'default' => 1.2, 'transport' => 'postMessage', 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_line_height', array( 'label' => esc_html__( 'Line height', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_heading_line_height', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.01, 'unit' => 'em' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_letter_spacing', array( 'default' => 0, 'transport' => 'postMessage', 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_letter_spacing', array( 'label' => esc_html__( 'Letter spacing', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_heading_letter_spacing', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_text_transform', array( 'default' => 'none', 'sanitize_callback' => 'acoustics_sanitize_text', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Acoustics_Control_RadioButtons( $wp_customize, 'acoustics_heading_text_transform', array( 'label' => esc_html__( 'Text transform', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'choices' => array( 'none' => '-', 'capitalize' => 'Aa', 'lowercase' => 'aa', 'uppercase' => 'AA', ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_typography_divider', array( 'sanitize_callback' => 'acoustics_sanitize_text' ) ); $wp_customize->add_control( new Acoustics_Control_Divider( $wp_customize, 'acoustics_heading_typography_divider', array( 'section' => 'acoustics_typography_heading', ) ) ); $wp_customize->add_setting( 'acoustics_heading_title', array( 'default' => '', 'sanitize_callback' => 'acoustics_sanitize_text' ) ); $wp_customize->add_control( new Acoustics_Control_Heading( $wp_customize, 'acoustics_heading_title', array( 'label' => esc_html__( 'Heading', 'acoustics' ), 'description' => esc_html__( '(H1 - h6) heading font size.', 'acoustics' ), 'section' => 'acoustics_typography_heading', ) ) ); $wp_customize->add_setting( 'acoustics_heading_h1_font_size_desktop', array( 'default' => 40, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h1_font_size_tablet', array( 'default' => 36, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h1_font_size_mobile', array( 'default' => 28, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h1_font_size', array( 'label' => esc_html__( 'H1 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h1_font_size_desktop', 'size_tablet' => 'acoustics_heading_h1_font_size_tablet', 'size_mobile' => 'acoustics_heading_h1_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_h2_font_size_desktop', array( 'default' => 32, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h2_font_size_tablet', array( 'default' => 28, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h2_font_size_mobile', array( 'default' => 22, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h2_font_size', array( 'label' => esc_html__( 'H2 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h2_font_size_desktop', 'size_tablet' => 'acoustics_heading_h2_font_size_tablet', 'size_mobile' => 'acoustics_heading_h2_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_h3_font_size_desktop', array( 'default' => 28, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h3_font_size_tablet', array( 'default' => 24, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h3_font_size_mobile', array( 'default' => 18, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h3_font_size', array( 'label' => esc_html__( 'H3 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h3_font_size_desktop', 'size_tablet' => 'acoustics_heading_h3_font_size_tablet', 'size_mobile' => 'acoustics_heading_h3_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_h4_font_size_desktop', array( 'default' => 24, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h4_font_size_tablet', array( 'default' => 20, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h4_font_size_mobile', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h4_font_size', array( 'label' => esc_html__( 'H4 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h4_font_size_desktop', 'size_tablet' => 'acoustics_heading_h4_font_size_tablet', 'size_mobile' => 'acoustics_heading_h4_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_h5_font_size_desktop', array( 'default' => 20, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h5_font_size_tablet', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h5_font_size_mobile', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h5_font_size', array( 'label' => esc_html__( 'H5 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h5_font_size_desktop', 'size_tablet' => 'acoustics_heading_h5_font_size_tablet', 'size_mobile' => 'acoustics_heading_h5_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_heading_h6_font_size_desktop', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h6_font_size_tablet', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_heading_h6_font_size_mobile', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_heading_h6_font_size', array( 'label' => esc_html__( 'H6 font size', 'acoustics' ), 'section' => 'acoustics_typography_heading', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_heading_h6_font_size_desktop', 'size_tablet' => 'acoustics_heading_h6_font_size_tablet', 'size_mobile' => 'acoustics_heading_h6_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); /*-------------------------------------------- Navigation ---------------------------------------------*/ $wp_customize->add_section( 'acoustics_typography_navigation', array( 'title' => esc_html__( 'Navigation', 'acoustics'), 'panel' => 'acoustics_typography_panel', ) ); $wp_customize->add_setting( 'acoustics_menu_font', array( 'default' => get_theme_mod( 'acoustics_base_font', '{"font":"System default","regularweight":"400","category":"sans-serif"}' ), 'sanitize_callback' => 'acoustics_google_fonts_sanitize' ) ); $wp_customize->add_control( new Acoustics_Control_Typography( $wp_customize, 'acoustics_menu_font', array( 'section' => 'acoustics_typography_navigation', 'settings' => array ( 'family' => 'acoustics_menu_font', ), 'input_attrs' => array( 'font_count' => 'all', 'orderby' => 'alpha', 'disableRegular' => false, ), ) ) ); $wp_customize->add_setting( 'acoustics_menu_font_style', array( 'sanitize_callback' => 'acoustics_sanitize_select', 'default' => 'normal' ) ); $wp_customize->add_control( 'acoustics_menu_font_style', array( 'type' => 'select', 'section' => 'acoustics_typography_navigation', 'label' => esc_html__( 'Font style', 'acoustics' ), 'choices' => array( 'normal' => esc_html__( 'Normal', 'acoustics' ), 'italic' => esc_html__( 'Italic', 'acoustics' ), 'oblique' => esc_html__( 'Oblique', 'acoustics' ), ), ) ); $wp_customize->add_setting( 'acoustics_menu_line_height', array( 'default' => 1.68, 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_menu_line_height', array( 'label' => esc_html__( 'Line height', 'acoustics' ), 'section' => 'acoustics_typography_navigation', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_menu_line_height', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.01, 'unit' => 'em' ) ) ) ); $wp_customize->add_setting( 'acoustics_menu_letter_spacing', array( 'default' => 0, 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_menu_letter_spacing', array( 'label' => esc_html__( 'Letter spacing', 'acoustics' ), 'section' => 'acoustics_typography_menu', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_menu_letter_spacing', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_menu_text_transform', array( 'default' => 'uppercase', 'sanitize_callback' => 'acoustics_sanitize_text' ) ); $wp_customize->add_control( new Acoustics_Control_RadioButtons( $wp_customize, 'acoustics_menu_text_transform', array( 'label' => esc_html__( 'Text transform', 'acoustics' ), 'section' => 'acoustics_typography_navigation', 'choices' => array( 'none' => '-', 'capitalize' => 'Aa', 'lowercase' => 'aa', 'uppercase' => 'AA', ) ) ) ); $wp_customize->add_setting( 'acoustics_menu_typography_divider', array( 'sanitize_callback' => 'acoustics_sanitize_text' ) ); $wp_customize->add_control( new Acoustics_Control_Divider( $wp_customize, 'acoustics_menu_typography_divider', array( 'section' => 'acoustics_typography_navigation', ) ) ); $wp_customize->add_setting( 'acoustics_menu_font_size_desktop', array( 'default' => 16, 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_menu_font_size_tablet', array( 'default' => 16, 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_menu_font_size_mobile', array( 'default' => 16, 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_menu_font_size', array( 'label' => esc_html__( 'Font size', 'acoustics' ), 'section' => 'acoustics_typography_navigation', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_menu_font_size_desktop', 'size_tablet' => 'acoustics_menu_font_size_tablet', 'size_mobile' => 'acoustics_menu_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) ); /*-------------------------------------------- Base ---------------------------------------------*/ $wp_customize->add_section( 'acoustics_typography_base', array( 'title' => esc_html__( 'Body', 'acoustics'), 'panel' => 'acoustics_typography_panel', ) ); $wp_customize->add_setting( 'acoustics_base_font', array( 'default' => '{"font":"System default","regularweight":"400","category":"sans-serif"}', 'sanitize_callback' => 'acoustics_google_fonts_sanitize', 'transport' => 'postMessage' ) ); $wp_customize->add_control( new Acoustics_Control_Typography( $wp_customize, 'acoustics_base_font', array( 'section' => 'acoustics_typography_base', 'settings' => array ( 'family' => 'acoustics_base_font', ), 'input_attrs' => array( 'font_count' => 'all', 'orderby' => 'alpha', 'disableRegular' => false, ), ) ) ); $wp_customize->add_setting( 'acoustics_base_font_style', array( 'sanitize_callback' => 'acoustics_sanitize_select', 'default' => 'normal', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'acoustics_base_font_style', array( 'type' => 'select', 'section' => 'acoustics_typography_base', 'label' => esc_html__( 'Font style', 'acoustics' ), 'choices' => array( 'normal' => esc_html__( 'Normal', 'acoustics' ), 'italic' => esc_html__( 'Italic', 'acoustics' ), 'oblique' => esc_html__( 'Oblique', 'acoustics' ), ), ) ); $wp_customize->add_setting( 'acoustics_base_line_height', array( 'default' => 1.68, 'transport' => 'postMessage', 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_base_line_height', array( 'label' => esc_html__( 'Line height', 'acoustics' ), 'section' => 'acoustics_typography_base', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_base_line_height', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.01, 'unit' => 'em' ) ) ) ); $wp_customize->add_setting( 'acoustics_base_letter_spacing', array( 'default' => 0, 'transport' => 'postMessage', 'sanitize_callback' => 'acoustics_sanitize_text', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_base_letter_spacing', array( 'label' => esc_html__( 'Letter spacing', 'acoustics' ), 'section' => 'acoustics_typography_base', 'responsive' => false, 'settings' => array ( 'size_desktop' => 'acoustics_base_letter_spacing', ), 'input_attrs' => array ( 'min' => 0, 'max' => 5, 'step' => 0.1, 'unit' => 'px' ) ) ) ); $wp_customize->add_setting( 'acoustics_base_text_transform', array( 'default' => 'none', 'sanitize_callback' => 'acoustics_sanitize_text', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Acoustics_Control_RadioButtons( $wp_customize, 'acoustics_base_text_transform', array( 'label' => esc_html__( 'Text transform', 'acoustics' ), 'section' => 'acoustics_typography_base', 'choices' => array( 'none' => '-', 'capitalize' => 'Aa', 'lowercase' => 'aa', 'uppercase' => 'AA', ) ) ) ); $wp_customize->add_setting( 'acoustics_base_typography_divider', array( 'sanitize_callback' => 'acoustics_sanitize_text' ) ); $wp_customize->add_control( new Acoustics_Control_Divider( $wp_customize, 'acoustics_base_typography_divider', array( 'section' => 'acoustics_typography_base', ) ) ); $wp_customize->add_setting( 'acoustics_base_font_size_desktop', array( 'default' => 16, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_base_font_size_tablet', array( 'default' => 14, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_setting( 'acoustics_base_font_size_mobile', array( 'default' => 14, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Acoustics_Control_Slider( $wp_customize, 'acoustics_base_font_size', array( 'label' => esc_html__( 'Font size', 'acoustics' ), 'section' => 'acoustics_typography_base', 'responsive' => true, 'settings' => array ( 'size_desktop' => 'acoustics_base_font_size_desktop', 'size_tablet' => 'acoustics_base_font_size_tablet', 'size_mobile' => 'acoustics_base_font_size_mobile', ), 'input_attrs' => array ( 'min' => 10, 'max' => 72, 'step' => 1, 'unit' => 'px' ) ) ) );