add_panel('bigmart_typography', array( 'priority' => 3, 'title' => esc_html__('Typography Settings', 'bigmart') )); // Add the body typography section. $wp_customize->add_section('bigmart_body_typography', array( 'panel' => 'bigmart_typography', 'title' => esc_html__('Body', 'bigmart') )); $wp_customize->add_setting('bigmart_body_font_family', array( 'default' => 'Poppins', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_font_style', array( 'default' => '400', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_text_decoration', array( 'default' => 'none', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_text_transform', array( 'default' => 'none', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_font_size', array( 'default' => '16', 'sanitize_callback' => 'absint', )); $wp_customize->add_setting('bigmart_body_line_height', array( 'default' => '1.6', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_letter_spacing', array( 'default' => '0', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_body_color', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new Bigmart_Typography($wp_customize, 'bigmart_body_typography', array( 'label' => esc_html__('Body Typography', 'bigmart'), 'section' => 'bigmart_body_typography', 'settings' => array( 'family' => 'bigmart_body_font_family', 'style' => 'bigmart_body_font_style', 'text_decoration' => 'bigmart_body_text_decoration', 'text_transform' => 'bigmart_body_text_transform', 'size' => 'bigmart_body_font_size', 'line_height' => 'bigmart_body_line_height', 'letter_spacing' => 'bigmart_body_letter_spacing', 'typocolor' => 'bigmart_body_color' ), 'input_attrs' => array( 'min' => 10, 'max' => 40, 'step' => 1 ) ))); // Add H1 typography section. $wp_customize->add_section('bigmart_header_typography', array( 'panel' => 'bigmart_typography', 'title' => esc_html__('Headers(H1, H2, H3, H4, H5, H6)', 'bigmart') )); $wp_customize->add_setting('bigmart_common_header_typography', array( 'sanitize_callback' => 'bigmart_sanitize_text', 'default' => true )); // Add H typography section. $wp_customize->add_setting('bigmart_h_font_family', array( 'default' => 'Poppins', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_h_font_style', array( 'default' => '600', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_h_text_decoration', array( 'default' => 'none', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_h_text_transform', array( 'default' => 'none', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_h_line_height', array( 'default' => '1.3', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_h_letter_spacing', array( 'default' => '0', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bigmart_Typography($wp_customize, 'bigmart_h_typography', array( 'label' => esc_html__('Header Typography', 'bigmart'), 'section' => 'bigmart_header_typography', 'settings' => array( 'family' => 'bigmart_h_font_family', 'style' => 'bigmart_h_font_style', 'text_decoration' => 'bigmart_h_text_decoration', 'text_transform' => 'bigmart_h_text_transform', 'line_height' => 'bigmart_h_line_height', 'letter_spacing' => 'bigmart_h_letter_spacing', ), 'input_attrs' => array( 'min' => 20, 'max' => 100, 'step' => 1 ) ))); // Add the Menu typography section. $wp_customize->add_section('bigmart_menu_typography', array( 'panel' => 'bigmart_typography', 'title' => esc_html__('Menu', 'bigmart') )); $wp_customize->add_setting('bigmart_menu_font_family', array( 'default' => 'Poppins', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_menu_font_style', array( 'default' => '400', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_menu_text_decoration', array( 'default' => 'none', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_menu_text_transform', array( 'default' => 'uppercase', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_menu_font_size', array( 'default' => '16', 'sanitize_callback' => 'absint', )); $wp_customize->add_setting('bigmart_menu_line_height', array( 'default' => '2', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_setting('bigmart_menu_letter_spacing', array( 'default' => '0', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Bigmart_Typography($wp_customize, 'bigmart_menu_typography', array( 'label' => esc_html__('Menu Typography', 'bigmart'), 'section' => 'bigmart_menu_typography', 'settings' => array( 'family' => 'bigmart_menu_font_family', 'style' => 'bigmart_menu_font_style', 'text_decoration' => 'bigmart_menu_text_decoration', 'text_transform' => 'bigmart_menu_text_transform', 'size' => 'bigmart_menu_font_size', 'line_height' => 'bigmart_menu_line_height', 'letter_spacing' => 'bigmart_menu_letter_spacing', ), 'input_attrs' => array( 'min' => 10, 'max' => 40, 'step' => 1 ) )));