diff --git a/inc/customizer/customizer-settings.php b/inc/customizer/customizer-settings.php index 87e0d8a..8a293da 100644 --- a/inc/customizer/customizer-settings.php +++ b/inc/customizer/customizer-settings.php @@ -1249,6 +1249,36 @@ function hovercraft_customizer($wp_customize) { ) ) ); + // get and format the first font family for google fonts + $first_font_family = get_theme_mod( 'hovercraft_first_font_family', 'noto_sans' ); + $first_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $first_font_family ) ) ); + + // get and format the second font family for google fonts + $second_font_family = get_theme_mod( 'hovercraft_second_font_family', 'open_sans' ); + $second_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $second_font_family ) ) ); + + // get and format the third font family for google fonts + $third_font_family = get_theme_mod( 'hovercraft_third_font_family', 'roboto' ); + $third_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $third_font_family ) ) ); + + // initialize an array for font families with the default option included + $hovercraft_font_families = array( + '' => __( 'Default (Unspecified)', 'hovercraft' ), // always include this as the first option + ); + + // add each formatted font family to the array if it's not empty or 'none' + if ( ! empty( $first_font_family ) && $first_font_family !== 'none' ) { + $hovercraft_font_families[ $first_font_family ] = $first_font_family_final; + } + + if ( ! empty( $second_font_family ) && $second_font_family !== 'none' ) { + $hovercraft_font_families[ $second_font_family ] = $second_font_family_final; + } + + if ( ! empty( $third_font_family ) && $third_font_family !== 'none' ) { + $hovercraft_font_families[ $third_font_family ] = $third_font_family_final; + } + // default font family setting $wp_customize->add_setting( 'hovercraft_default_font', array( 'default' => '', @@ -1308,36 +1338,6 @@ function hovercraft_customizer($wp_customize) { 'type' => 'text' ) ) ); - - // get and format the first font family for google fonts - $first_font_family = get_theme_mod( 'hovercraft_first_font_family', 'noto_sans' ); - $first_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $first_font_family ) ) ); - - // get and format the second font family for google fonts - $second_font_family = get_theme_mod( 'hovercraft_second_font_family', 'open_sans' ); - $second_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $second_font_family ) ) ); - - // get and format the third font family for google fonts - $third_font_family = get_theme_mod( 'hovercraft_third_font_family', 'roboto' ); - $third_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $third_font_family ) ) ); - - // initialize an array for font families with the default option included - $hovercraft_font_families = array( - '' => __( 'Default (Unspecified)', 'hovercraft' ), // always include this as the first option - ); - - // add each formatted font family to the array if it's not empty or 'none' - if ( ! empty( $first_font_family ) && $first_font_family !== 'none' ) { - $hovercraft_font_families[ $first_font_family ] = $first_font_family_final; - } - - if ( ! empty( $second_font_family ) && $second_font_family !== 'none' ) { - $hovercraft_font_families[ $second_font_family ] = $second_font_family_final; - } - - if ( ! empty( $third_font_family ) && $third_font_family !== 'none' ) { - $hovercraft_font_families[ $third_font_family ] = $third_font_family_final; - } // add setting for site name font family $wp_customize->add_setting( 'hovercraft_site_name_font', array(