Make WordPress Core

Ticket #47282: 47282.3.diff

File 47282.3.diff, 4.9 KB (added by westonruter, 5 years ago)

Switch from swap to fallback Δ https://github.com/westonruter/wordpress-develop/pull/1/commits/5aeb0f5852c78a75844f3dd32de609da181694ef

  • src/wp-content/themes/twentyfifteen/functions.php

    diff --git a/src/wp-content/themes/twentyfifteen/functions.php b/src/wp-content/themes/twentyfifteen/functions.php
    index db6451f0b9..f312ce9e7c 100644
    a b if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) : 
    331331                if ( $fonts ) {
    332332                        $fonts_url = add_query_arg(
    333333                                array(
    334                                         'family' => urlencode( implode( '|', $fonts ) ),
    335                                         'subset' => urlencode( $subsets ),
     334                                        'family'  => urlencode( implode( '|', $fonts ) ),
     335                                        'subset'  => urlencode( $subsets ),
     336                                        'display' => urlencode( 'fallback' ),
    336337                                ),
    337338                                'https://fonts.googleapis.com/css'
    338339                        );
  • src/wp-content/themes/twentyfourteen/functions.php

    diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php
    index c017dac644..29b68e4065 100644
    a b function twentyfourteen_font_url() { 
    294294         */
    295295        if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) {
    296296                $query_args = array(
    297                         'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ),
    298                         'subset' => urlencode( 'latin,latin-ext' ),
     297                        'family'  => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ),
     298                        'subset'  => urlencode( 'latin,latin-ext' ),
     299                        'display' => urlencode( 'fallback' ),
    299300                );
    300301                $font_url   = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
    301302        }
  • src/wp-content/themes/twentyseventeen/functions.php

    diff --git a/src/wp-content/themes/twentyseventeen/functions.php b/src/wp-content/themes/twentyseventeen/functions.php
    index a8f10773f9..4ae518db11 100644
    a b function twentyseventeen_fonts_url() { 
    294294                $font_families[] = 'Libre Franklin:300,300i,400,400i,600,600i,800,800i';
    295295
    296296                $query_args = array(
    297                         'family' => urlencode( implode( '|', $font_families ) ),
    298                         'subset' => urlencode( 'latin,latin-ext' ),
     297                        'family'  => urlencode( implode( '|', $font_families ) ),
     298                        'subset'  => urlencode( 'latin,latin-ext' ),
     299                        'display' => urlencode( 'fallback' ),
    299300                );
    300301
    301302                $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
  • src/wp-content/themes/twentysixteen/functions.php

    diff --git a/src/wp-content/themes/twentysixteen/functions.php b/src/wp-content/themes/twentysixteen/functions.php
    index 68e4a5ef03..4b383b2e12 100644
    a b if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : 
    331331                if ( $fonts ) {
    332332                        $fonts_url = add_query_arg(
    333333                                array(
    334                                         'family' => urlencode( implode( '|', $fonts ) ),
    335                                         'subset' => urlencode( $subsets ),
     334                                        'family'  => urlencode( implode( '|', $fonts ) ),
     335                                        'subset'  => urlencode( $subsets ),
     336                                        'display' => urlencode( 'fallback' ),
    336337                                ),
    337338                                'https://fonts.googleapis.com/css'
    338339                        );
  • src/wp-content/themes/twentythirteen/functions.php

    diff --git a/src/wp-content/themes/twentythirteen/functions.php b/src/wp-content/themes/twentythirteen/functions.php
    index 5c021fbe3c..f2823fd50e 100644
    a b function twentythirteen_fonts_url() { 
    243243                }
    244244
    245245                $query_args = array(
    246                         'family' => urlencode( implode( '|', $font_families ) ),
    247                         'subset' => urlencode( 'latin,latin-ext' ),
     246                        'family'  => urlencode( implode( '|', $font_families ) ),
     247                        'subset'  => urlencode( 'latin,latin-ext' ),
     248                        'display' => urlencode( 'fallback' ),
    248249                );
    249250                $fonts_url  = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
    250251        }
  • src/wp-content/themes/twentytwelve/functions.php

    diff --git a/src/wp-content/themes/twentytwelve/functions.php b/src/wp-content/themes/twentytwelve/functions.php
    index ad89b2ac72..2a31155990 100644
    a b function twentytwelve_get_font_url() { 
    165165                }
    166166
    167167                $query_args = array(
    168                         'family' => 'Open+Sans:400italic,700italic,400,700',
    169                         'subset' => $subsets,
     168                        'family'  => urlencode( 'Open+Sans:400italic,700italic,400,700' ),
     169                        'subset'  => urlencode( $subsets ),
     170                        'display' => urlencode( 'fallback' ),
    170171                );
    171172                $font_url   = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
    172173        }
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index eec109dffa..de3dcd081f 100644
    a b function wp_default_styles( &$styles ) { 
    19141914                }
    19151915
    19161916                // Hotlink Open Sans, for now
    1917                 $open_sans_font_url = "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";
     1917                $open_sans_font_url = "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets&display=fallback";
    19181918        }
    19191919
    19201920        // Register a stylesheet for the selected admin color scheme.