Skip to content

Commit

Permalink
Add missing value to CSS font-display descriptor in theme.json (#44622)
Browse files Browse the repository at this point in the history
* Add missing value to fontDisplay descriptor in theme.json
* Add "optional" value to array check
  • Loading branch information
pagelab authored Oct 3, 2022
1 parent 54ad2cd commit 1104c68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/experimental/class-wp-webfonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function validate_webfont( $webfont ) {
}

// Check the font-display.
if ( ! in_array( $webfont['font-display'], array( 'auto', 'block', 'fallback', 'swap' ), true ) ) {
if ( ! in_array( $webfont['font-display'], array( 'auto', 'block', 'fallback', 'swap', 'optional' ), true ) ) {
$webfont['font-display'] = 'fallback';
}

Expand Down
3 changes: 2 additions & 1 deletion schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@
"auto",
"block",
"fallback",
"swap"
"swap",
"optional"
]
},
"src": {
Expand Down

0 comments on commit 1104c68

Please sign in to comment.