Skip to content

Commit

Permalink
Update customizer-settings.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jessuppi authored Nov 8, 2024
1 parent cd303ce commit 843bd81
Showing 1 changed file with 4 additions and 42 deletions.
46 changes: 4 additions & 42 deletions inc/customizer/customizer-settings.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

function hovercraft_customizer($wp_customize) {
// load google fonts array
$hovercraft_google_fonts_array = hovercraft_google_fonts_array();
// load google fonts array (via functions.php)
$hovercraft_google_fonts_array = hovercraft_google_fonts_array();

// load google fonts multilingual array
$hovercraft_google_fonts_multilingual_array = hovercraft_google_fonts_multilingual_array();
// load google fonts multilingual array (via functions.php)
$hovercraft_google_fonts_multilingual_array = hovercraft_google_fonts_multilingual_array();

// remove header text color control
$wp_customize->remove_control('header_textcolor');
Expand Down Expand Up @@ -1252,44 +1252,6 @@ 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 ) ) );

// get and format the multilingual font family for google fonts
$multilingual_font_family = get_theme_mod( 'hovercraft_multilingual_font_family', 'none' );
$multilingual_font_family_final = ucwords( str_replace( '_', ' ', ucfirst( $multilingual_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;
}

if ( ! empty( $multilingual_font_family ) && $multilingual_font_family !== 'none' ) {
$hovercraft_font_families[ $multilingual_font_family ] = $multilingual_font_family_final;
}

// default font family setting
$wp_customize->add_setting( 'hovercraft_default_font', array(
'default' => '',
Expand Down

0 comments on commit 843bd81

Please sign in to comment.