From e3f4d4e96121fcef77a83b667e9bb600ec8d9ee3 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 3 Oct 2022 10:38:14 +0200 Subject: [PATCH] Add 'optional' to the list of supported values Porting https://github.com/WordPress/gutenberg/pull/44622 --- lib/experimental/class-wp-webfonts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/experimental/class-wp-webfonts.php b/lib/experimental/class-wp-webfonts.php index 45f8574e7be436..d4daec83db98c7 100644 --- a/lib/experimental/class-wp-webfonts.php +++ b/lib/experimental/class-wp-webfonts.php @@ -362,8 +362,8 @@ private function validate_variation( $variation ) { } // Check the font-display. - if ( ! in_array( $webfont['font-display'], array( 'auto', 'block', 'fallback', 'swap', 'optional' ), true ) ) { - $webfont['font-display'] = 'fallback'; + if ( ! in_array( $variation['font-display'], array( 'auto', 'block', 'fallback', 'swap', 'optional' ), true ) ) { + $variation['font-display'] = 'fallback'; } $valid_props = array(