Make WordPress Core

Changeset 55982


Ignore:
Timestamp:
06/22/2023 06:20:19 AM (10 months ago)
Author:
audrasjb
Message:

Twenty Thirteen: 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 replaces the content of html5.js shiv with a comment (to avoid 404s), and removes IE specific code from header.php.

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

Location:
trunk/src/wp-content/themes/twentythirteen
Files:
3 edited

Legend:

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

    r55929 r55982  
    337337    wp_enqueue_style( 'twentythirteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentythirteen-style' ), '20230122' );
    338338
    339     // Loads the Internet Explorer specific stylesheet.
    340     wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '20150214' );
     339    // Registers the Internet Explorer specific stylesheet.
     340    wp_register_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '20150214' );
    341341    wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
    342342}
  • trunk/src/wp-content/themes/twentythirteen/header.php

    r55276 r55982  
    1010 */
    1111?><!DOCTYPE html>
    12 <!--[if IE 7]>
    13 <html class="ie ie7" <?php language_attributes(); ?>>
    14 <![endif]-->
    15 <!--[if IE 8]>
    16 <html class="ie ie8" <?php language_attributes(); ?>>
    17 <![endif]-->
    18 <!--[if !(IE 7) & !(IE 8)]><!-->
    1912<html <?php language_attributes(); ?>>
    20 <!--<![endif]-->
    2113<head>
    2214    <meta charset="<?php bloginfo( 'charset' ); ?>">
     
    2517    <link rel="profile" href="https://gmpg.org/xfn/11">
    2618    <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
    27     <!--[if lt IE 9]>
    28     <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js?ver=3.7.0"></script>
    29     <![endif]-->
    3019    <?php wp_head(); ?>
    3120</head>
  • trunk/src/wp-content/themes/twentythirteen/js/html5.js

    r27263 r55982  
    1 /*
    2  HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
    3 */
    4 (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
    5 a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
    6 c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
    7 "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
    8 if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
     1// This theme does not support old versions of Microsoft Internet Explorer anymore.
Note: See TracChangeset for help on using the changeset viewer.