Script Loader: Add support for font-display: optional.

This adds `optional` to the list of valid `font-display` values that can be used when validating webfonts.

Props merel1988, asafm7, mukesh27.
Fixes #58454.


git-svn-id: https://develop.svn.wordpress.org/trunk@56314 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill
2023-07-26 19:21:44 +00:00
parent a0b15f354a
commit d15f776031

View File

@@ -3399,7 +3399,7 @@ function _wp_theme_json_webfonts_handler() {
}
// 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', 'optional', 'swap' ), true ) ) {
$webfont['font-display'] = 'fallback';
}