From 18ee9aa891c2b1b4db9c24c61832232668256464 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Wed, 3 Jan 2024 03:36:38 +1300 Subject: [PATCH] Add full `siteorigin_web_font_url` support --- functions.php | 6 +++--- inc/customizer/customizer.php | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index 75c1399..05141b2 100644 --- a/functions.php +++ b/functions.php @@ -256,21 +256,21 @@ function origami_save_post($post_id){ * This just displays the Google web fonts */ function origami_enqueue_google_webfonts(){ + $google_fonts_url = esc_url( apply_filters( 'siteorigin_web_font_url', 'https://fonts.googleapis.com/css' ) ); if( ! get_header_image() ){ // Enqueue the logo font as well (Terminal Dosis 200) - wp_enqueue_style('google-webfonts', '//fonts.googleapis.com/css?family=Terminal+Dosis:200,400'); + wp_enqueue_style('google-webfonts', $google_fonts_url . '?family=Terminal+Dosis:200,400'); } else{ // Enqueue only the text fonts that we need - wp_enqueue_style('google-webfonts', '//fonts.googleapis.com/css?family=Terminal+Dosis:400'); + wp_enqueue_style('google-webfonts', $google_fonts_url . '?family=Terminal+Dosis:400'); } } endif; add_action('wp_enqueue_scripts', 'origami_enqueue_google_webfonts'); - if(!function_exists('origami_comment')) : /** * Display a comment diff --git a/inc/customizer/customizer.php b/inc/customizer/customizer.php index e70f131..5a19b50 100755 --- a/inc/customizer/customizer.php +++ b/inc/customizer/customizer.php @@ -83,27 +83,33 @@ function __construct($defaults) { /** * Echo all the CSS */ - function css() { + public function css() { // Start by importing Google web fonts $return = ''; + return $return; } @@ -570,7 +576,7 @@ function create_css_builder(){ } } } - + if ( isset( $setting['callback'] ) ) { $val = get_theme_mod( $id ); if ( isset( $setting['default'] ) && $val != $setting['default'] ) {