Make WordPress Core

Ticket #30678: 30678.diff

File 30678.diff, 1.7 KB (added by obenland, 10 years ago)

Set variable at beginning of function and remove dependency on fonts.

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

     
    150150 * @return string Google fonts URL for the theme.
    151151 */
    152152function twentyfifteen_fonts_url() {
    153         $fonts   = array();
    154         $subsets = 'latin,latin-ext';
     153        $fonts_url = '';
     154        $fonts     = array();
     155        $subsets   = 'latin,latin-ext';
    155156
    156157        /* translators: If there are characters in your language that are not supported by Noto Sans, translate this to 'off'. Do not translate into your own language. */
    157158        if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) {
     
    181182                $subsets .= ',vietnamese';
    182183        }
    183184
    184         return add_query_arg( array(
    185                 'family' => urlencode( implode( '|', $fonts ) ),
    186                 'subset' => urlencode( $subsets ),
    187         ), '//fonts.googleapis.com/css' );
     185        if ( $fonts ) {
     186                $fonts_url = add_query_arg( array(
     187                        'family' => urlencode( implode( '|', $fonts ) ),
     188                        'subset' => urlencode( $subsets ),
     189                ), '//fonts.googleapis.com/css' );
     190        }
     191
     192        return $fonts_url;
    188193}
    189194endif;
    190195
     
    201206        wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2' );
    202207
    203208        // Load our main stylesheet.
    204         wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri(), array( 'twentyfifteen-fonts', 'genericons' ) );
     209        wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri(), array( 'genericons' ) );
    205210
    206211        // Load the Internet Explorer specific stylesheet.
    207212        wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20141010' );