Skip to content

Commit 3006a24

Browse files
committed
Bullet proofing some args theme devs leave out of their global array.
Signed-off-by: Kev Provance <[email protected]>
1 parent 7388a02 commit 3006a24

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

redux-core/inc/classes/class-redux-output.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ public function enqueue() {
177177

178178
$typography = new Redux_Typography( null, null, $core );
179179

180+
$core->args['disable_google_fonts_link'] = ( ! isset( $core->args['disable_google_fonts_link'] ) ? false : $core->args['disable_google_fonts_link'] );
181+
var_dump($core->args['disable_google_fonts_link']);
180182
if ( ! $core->args['disable_google_fonts_link'] ) {
181183
$url = $typography->make_google_web_font_link( Redux_Core::$typography );
182184
wp_enqueue_style( 'redux-google-fonts-' . $core->args['opt_name'], $url, array(), $version );

redux-core/inc/fields/typography/class-redux-typography.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,10 @@ public function make_google_web_font_link( array $fonts ): string {
10171017
if ( ! empty( $subsets ) ) {
10181018
$link .= '&subset=' . implode( ',', $subsets );
10191019
}
1020-
$link .= '&display=' . $this->parent->args['font_display'];
1020+
1021+
$display = $this->parent->args['font_display'] ?? 'swap';
1022+
1023+
$link .= '&display=' . $display;
10211024

10221025
// return 'https://fonts.bunny.net/css?family=' . $link;
10231026
return 'https://fonts.googleapis.com/css?family=' . $link;

0 commit comments

Comments
 (0)