Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #58454


Ignore:
Timestamp:
06/05/2023 03:00:39 AM (3 years ago)
Author:
sabernhardt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58454

    • Property Component GeneralScript Loader
  • Ticket #58454 – Description

    initial v1  
    1 script-loader.php doesn't support font-display: optional, which is recommended by Google to reduce CLS.
     1script-loader.php doesn't support `font-display: optional`, which is recommended by Google to reduce Cumulative Layout Shift.
    22
    33Current code:
     
    55{{{
    66        // Check the font-display.
    7         if (!in_array($webfont['font-display'], array('auto', 'block', 'fallback', 'swap'), true)) {
     7        if ( ! in_array( $webfont['font-display'], array( 'auto', 'block', 'fallback', 'swap' ), true ) ) {
    88            $webfont['font-display'] = 'fallback';
    99        }
    1010}}}
    1111
    12 font-display: optional combined with https://web.dev/preload-optional-fonts/ is recommended by Google to reduce CLS:
    13 
     12`font-display: optional` combined with `rel="preload"` is recommended by Google to reduce CLS:
    1413https://web.dev/preload-optional-fonts/