Make WordPress Core

Ticket #38387: 38387.diff

File 38387.diff, 1.2 KB (added by swissspidy, 7 years ago)
  • src/wp-content/themes/twentyseventeen/inc/icon-functions.php

    diff --git src/wp-content/themes/twentyseventeen/inc/icon-functions.php src/wp-content/themes/twentyseventeen/inc/icon-functions.php
    index 695ea6e..2ad982b 100644
    function twentyseventeen_get_svg( $args = array() ) { 
    8383                $svg .= '<desc>' . esc_html( $args['desc'] ) . '</desc>';
    8484        }
    8585
    86         // Use absolute path in the Customizer so that icons show up in there.
     86        /*
     87         * Use absolute path in the Customizer so that icons show up in there.
     88         *
     89         * The whitespace around `<use>` is intentional. See https://core.trac.wordpress.org/ticket/38387.
     90         */
    8791        if ( is_customize_preview() ) {
    88                 $svg .= '<use xlink:href="' . get_parent_theme_file_uri( '/assets/images/svg-icons.svg#icon-' . esc_html( $args['icon'] ) ) . '"></use>';
     92                $svg .= ' <use xlink:href="' . get_parent_theme_file_uri( '/assets/images/svg-icons.svg#icon-' . esc_html( $args['icon'] ) ) . '"></use> ';
    8993        } else {
    90                 $svg .= '<use xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use>';
     94                $svg .= ' <use xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use> ';
    9195        }
    9296
    9397        // Add some markup to use as a fallback for browsers that do not support SVGs.