add_panel( 'astha_typo', array( 'title' => __( 'Typography', 'astha' ), 'description' => esc_html__( 'Astha Typography control. User will able to Control of whole site Typography from here. There are some System Fonts and rest all are Google fonts.', 'astha' ), 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); /** * Section of BODY FONTS AND STYLE */ $wp_customize->add_section( 'astha_typo_root', array( 'title' => __( 'Theme Basic Font', 'astha' ), 'description' => __( 'Chose your website basic font. It will appaly on p, span, input, textarea, button etc tag.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Primary Font for Root Font style $wp_customize->add_setting( 'astha_root_font[--astha-font-primary]', array( 'default' => __( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_root_font[--astha-font-primary]', array( 'label' => __( 'Primary Font', 'astha' ), 'description' => __( 'Our receommeded Primary font is: Work Sanse. It will appaly on p, span, input, textarea, button etc tag.', 'astha' ), 'settings' => 'astha_root_font[--astha-font-primary]', 'section' => 'astha_typo_root', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Secondary Font for Root Font style $wp_customize->add_setting( 'astha_root_font[--astha-font-secondary]', array( 'default' => __( 'Roboto', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_root_font[--astha-font-secondary]', array( 'label' => __( 'Secondary Font', 'astha' ), 'description' => __( 'Our receommeded Secondary font is: Work Sanse. It will appaly on p, span, input, textarea, button etc tag.', 'astha' ), 'settings' => 'astha_root_font[--astha-font-secondary]', 'section' => 'astha_typo_root', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); /** * Section of BODY FONTS AND STYLE */ $wp_customize->add_section( 'astha_typo_body', array( 'title' => __( 'Body Text', 'astha' ), 'description' => __( 'Override your basic Typography. Such: for p,span,input,textarea,button etc tag.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_body_font[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_bd_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_body_font[font-family]', 'section' => 'astha_typo_body', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); /**************************/ //Why I have remove this part. Because of this part, after set font size on by, site is not working properly //mainly for icon font //Font Size $wp_customize->add_setting( 'astha_body_font[font-size]', array( 'default' => '',// old 'default' => 15, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_bd_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_typo_body', 'priority' => 10, 'settings' => 'astha_body_font[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_body_font[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_bd_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_typo_body', 'settings' => 'astha_body_font[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_body_font[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_bd_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_typo_body', 'settings' => 'astha_body_font[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_body_font[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_bd_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_typo_body', 'settings' => 'astha_body_font[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); //*************************************************/ /** * Maybe no need this part. * This part er jinis ebong ager body text a diye dibo * * Section: All P Content * $wp_customize->add_section( 'astha_content_text', array( 'title' => __( 'Paragraph - Text', 'astha' ), 'description' => __( 'Control your website Heading Typography', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_content_text[font-family]', array( 'default' => '',// old 'default' => '',//__( 'Roboto', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_p_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_content_text[font-family]', 'section' => 'astha_content_text', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_content_text[font-size]', array( 'default' => '',// old 'default' => 36, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_p_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_content_text', 'priority' => 10, 'settings' => 'astha_content_text[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_content_text[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_p_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_content_text', 'settings' => 'astha_content_text[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_content_text[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_p_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_content_text', 'settings' => 'astha_content_text[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_content_text[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_p_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_content_text', 'settings' => 'astha_content_text[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); //*************************************************/ /** * Section: All Headings */ $wp_customize->add_section( 'astha_heading', array( 'title' => __( 'All Headings', 'astha' ), 'description' => __( 'Override Heading Typography', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_heading[font-family]', array( 'default' => '',// old 'default' => '',//__( 'Roboto', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_heading[font-family]', 'section' => 'astha_heading', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_heading[font-size]', array( 'default' => '',// old 'default' => 36, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_heading', 'priority' => 10, 'settings' => 'astha_heading[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_heading[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_heading', 'settings' => 'astha_heading[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_heading[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_heading', 'settings' => 'astha_heading[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_heading[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_heading', 'settings' => 'astha_heading[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 1 */ $wp_customize->add_section( 'astha_h1', array( 'title' => __( 'Heading 1 (H1)', 'astha' ), 'description' => __( 'Override H1 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h1[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h1_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h1[font-family]', 'section' => 'astha_h1', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h1[font-size]', array( 'default' => '',// old 'default' => 36, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h1_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h1', 'priority' => 10, 'settings' => 'astha_h1[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h1[text-transform]', array( 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h1_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h1', 'settings' => 'astha_h1[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h1[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h1_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h1', 'settings' => 'astha_h1[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h1[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h1_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h1', 'settings' => 'astha_h1[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 2 */ $wp_customize->add_section( 'astha_h2', array( 'title' => __( 'Heading 2 (H2)', 'astha' ), 'description' => __( 'Override H2 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h2[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h2_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h2[font-family]', 'section' => 'astha_h2', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h2[font-size]', array( 'default' => '',// old 'default' => 26, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h2_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h2', 'priority' => 10, 'settings' => 'astha_h2[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h2[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h2_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h2', 'settings' => 'astha_h2[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h2[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h2_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h2', 'settings' => 'astha_h2[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h2[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h2_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h2', 'settings' => 'astha_h2[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 3 */ $wp_customize->add_section( 'astha_h3', array( 'title' => __( 'Heading 3 (H3)', 'astha' ), 'description' => __( 'Override H3 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h3[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h3_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h3[font-family]', 'section' => 'astha_h3', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h3[font-size]', array( 'default' => '',// old 'default' => 20, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h3_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h3', 'priority' => 10, 'settings' => 'astha_h3[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h3[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h3_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h3', 'settings' => 'astha_h3[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h3[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h3_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h3', 'settings' => 'astha_h3[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h3[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h3_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h3', 'settings' => 'astha_h3[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 4 */ $wp_customize->add_section( 'astha_h4', array( 'title' => __( 'Heading 4 (H4)', 'astha' ), 'description' => __( 'Override H4 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h4[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h4_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h4[font-family]', 'section' => 'astha_h4', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h4[font-size]', array( 'default' => '',// old 'default' => 20, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h4_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h4', 'priority' => 10, 'settings' => 'astha_h4[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h4[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h4_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h4', 'settings' => 'astha_h4[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h4[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h4_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h4', 'settings' => 'astha_h4[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h4[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h4_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h4', 'settings' => 'astha_h4[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 5 */ $wp_customize->add_section( 'astha_h5', array( 'title' => __( 'Heading 5 (H5)', 'astha' ), 'description' => __( 'Override H5 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h5[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h5_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h5[font-family]', 'section' => 'astha_h5', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h5[font-size]', array( 'default' => '',// old 'default' => 20, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h5_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h5', 'priority' => 10, 'settings' => 'astha_h5[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h5[text-transform]', array( 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h5_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h5', 'settings' => 'astha_h5[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h5[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h5_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h5', 'settings' => 'astha_h5[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h5[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h5_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h5', 'settings' => 'astha_h5[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); /** * Section: Heading 6 */ $wp_customize->add_section( 'astha_h6', array( 'title' => __( 'Heading 6 (H6)', 'astha' ), 'description' => __( 'Override H6 Typography.', 'astha' ), 'panel' => 'astha_typo', //'priority' => 1, 'capability' => 'edit_theme_options', 'theme_support' => '', 'active_callback'=> '', ) ); //Font Family $wp_customize->add_setting( 'astha_h6[font-family]', array( 'default' => '',//__( 'Work Sans', 'astha' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h6_font_family', array( 'label' => __( 'Font Family', 'astha' ), 'settings' => 'astha_h6[font-family]', 'section' => 'astha_h6', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_choices(), 'input_attrs' => array( 'class' => 'select2', 'placeholder' => 'Choose Font', ), ) ); //Font Size $wp_customize->add_setting( 'astha_h6[font-size]', array( 'default' => '',// old 'default' => 20, 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h6_font_size', array( 'label' => __( 'Font Size', 'astha' ), 'section' => 'astha_h6', 'priority' => 10, 'settings' => 'astha_h6[font-size]', 'capability' => 'edit_theme_options', 'type' => 'number', 'input_attrs' => array( 'min' => 5, 'max' => 66, ), ) ); //Text Transform $wp_customize->add_setting( 'astha_h6[text-transform]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h6_font_text_transform', array( 'label' => __( 'Text Transform', 'astha' ), 'section' => 'astha_h6', 'settings' => 'astha_h6[text-transform]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_transform_choices(), ) ); //Font Weight $wp_customize->add_setting( 'astha_h6[font-weight]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h6_font_weight', array( 'label' => __( 'Font-Weight', 'astha' ), 'section' => 'astha_h6', 'settings' => 'astha_h6[font-weight]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_weight_choices(), ) ); //Font Style $wp_customize->add_setting( 'astha_h6[font-style]', array( 'default' => '',// old 'default' => 'inherit', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'astha_h6_font_style', array( 'label' => __( 'Font Style', 'astha' ), 'section' => 'astha_h6', 'settings' => 'astha_h6[font-style]', 'priority' => 10, 'capability' => 'edit_theme_options', 'type' => 'select', 'choices' => Astha_Fonts_Manage::fonts_style_choices(), ) ); } } add_action( 'customize_register', 'astha_typography_register' ); if( ! function_exists( 'astha_load_google_fonts' ) ){ /** * Astha Fonts Loading * Google Fonts Loaded based on Selection * * @return Void Enequeue Google Fonts File */ function astha_load_google_fonts() { // $google_font_url = '//fonts.googleapis.com/css?family='; $google_font_url = 'https://fonts.googleapis.com/css2?family='; $google_font_url = apply_filters( 'astha_google_font_url', $google_font_url ); $fonts_args = array( 'astha_root_font', 'astha_body_font', 'astha_heading', 'astha_h1', 'astha_h2', 'astha_h3', 'astha_h4', 'astha_h5', 'astha_h6', ); if( ! is_array( $fonts_args ) ){ return; } $font_additonal = ':wght@100;200;300;400;500;600;700&display=swap'; // $font_additonal = ':wght@400;500;600;700&display=swap'; $font_additonal = apply_filters( 'astha_font_additional_info', $font_additonal ); foreach( $fonts_args as $fonts ){ $fnt_mod = get_theme_mod( $fonts ); /** * Hooked: astha_root_font_from_page -10 lib/bulldozer.php */ $fnt_mod = apply_filters( 'astha_font_mod_arr', $fnt_mod, $fonts, $fonts_args ); if( $fonts === 'astha_root_font' ){ $font_root = $fnt_mod; /** * @Hooked: astha_root_font_from_page -10 at lib/bulldozer.php * * Fonts Array from Customizer * Array Sample * array (size=2) '--astha-font-primary' => string 'Work Sans' (length=9) '--astha-font-secondary' => string 'Roboto' (length=6) * * @param Array $font_root A array of Fonts where available Font's Array with Root Name * @param Array/Bool $fonts_args $fonts_args is an Array of All type Typography Args * * @Hooked: astha_root_font_from_page -10 at lib/bulldozer.php */ $font_root = apply_filters( 'astha_root_font_arr', $font_root, $fonts_args ); //Convert as Array $font_root = is_array( $font_root ) ? $font_root : array(); foreach( $font_root as $root_font ){ if( ! empty( $root_font ) ){ wp_enqueue_style( $root_font, $google_font_url . $root_font . $font_additonal, array(), ASTHA_VERSION ); } } } if( !empty( $fnt_mod['font-family'] ) ){ $font_name = $fnt_mod['font-family']; wp_enqueue_style( $fonts, $google_font_url . $font_name . $font_additonal, array(), ASTHA_VERSION ); } } } } add_action( 'wp_enqueue_scripts', 'astha_load_google_fonts' ); //wp_enqueue_scripts if( ! function_exists( 'astha_typography_head_style' ) ){ /** * Generate CSS Code, I mean: Style tag * at the Head tag of the site. * * We have code here for * primary root color and font * * as well as body, heading tag's style for font, color etc */ function astha_typography_head_style() { $output = ''; echo $output; } } add_action( 'wp_head', 'astha_typography_head_style' ); //wp_enqueue_scripts