Make WordPress Core


Ignore:
Timestamp:
06/22/2023 05:59:43 AM (2 years ago)
Author:
audrasjb
Message:

Twenty Seventeen: Remove IE specific resources.

This changeset switches the wp_enqueue_* functions to wp_register_* for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.

It also replace the content of html5.js shiv with a comment (to avoid 404s) and removes IE-specific code in general stylesheets.

Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r55929 r55980  
    463463    }
    464464
    465     // Load the Internet Explorer 9 specific stylesheet, to fix display issues in the Customizer.
     465    // Register the Internet Explorer 9 specific stylesheet, to fix display issues in the Customizer.
    466466    if ( is_customize_preview() ) {
    467         wp_enqueue_style( 'twentyseventeen-ie9', get_theme_file_uri( '/assets/css/ie9.css' ), array( 'twentyseventeen-style' ), '20161202' );
     467        wp_register_style( 'twentyseventeen-ie9', get_theme_file_uri( '/assets/css/ie9.css' ), array( 'twentyseventeen-style' ), '20161202' );
    468468        wp_style_add_data( 'twentyseventeen-ie9', 'conditional', 'IE 9' );
    469469    }
    470470
    471     // Load the Internet Explorer 8 specific stylesheet.
    472     wp_enqueue_style( 'twentyseventeen-ie8', get_theme_file_uri( '/assets/css/ie8.css' ), array( 'twentyseventeen-style' ), '20161202' );
     471    // Register the Internet Explorer 8 specific stylesheet.
     472    wp_register_style( 'twentyseventeen-ie8', get_theme_file_uri( '/assets/css/ie8.css' ), array( 'twentyseventeen-style' ), '20161202' );
    473473    wp_style_add_data( 'twentyseventeen-ie8', 'conditional', 'lt IE 9' );
    474474
    475     // Load the html5 shiv.
    476     wp_enqueue_script( 'html5', get_theme_file_uri( '/assets/js/html5.js' ), array(), '20161020' );
     475    // Register the html5 shiv.
     476    wp_register_style( 'html5', get_theme_file_uri( '/assets/js/html5.js' ), array(), '20161020' );
    477477    wp_script_add_data( 'html5', 'conditional', 'lt IE 9' );
    478478
Note: See TracChangeset for help on using the changeset viewer.