Make WordPress Core


Ignore:
Timestamp:
02/13/2026 04:13:53 PM (3 months ago)
Author:
joedolson
Message:

Twenty Twenty One: Remove Skiplink shim for Internet Explorer.

No version of Internet Explorer is still supported by WordPress or Microsoft. Usage of Internet Explorer has dropped to about 0.1%.

Follow up to [61628] to also remove JS that fixed skip link behavior for IE. Also remove overlooked contents of ie-editor.css.map.

Props sabernhardt, westonruter, joedolson.
Fixes #64590.

File:
1 edited

Legend:

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

    r61628 r61635  
    458458
    459459/**
    460  * Fixes skip link focus in IE11.
    461  *
    462  * This does not enqueue the script because it is tiny and because it is only for IE11,
    463  * thus it does not warrant having an entire dedicated blocking script being loaded.
     460 * Adds an HTML comment about the lack of Internet Explorer support.
     461 *
     462 * This originally printed a script to fix the skip link focus behavior in IE11.
    464463 *
    465464 * @since Twenty Twenty-One 1.0
    466465 * @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action.
     466 * @deprecated Twenty Twenty-One 2.8 Removed Internet Explorer support.
    467467 *
    468468 * @link https://git.io/vWdr2
    469469 */
    470470function twenty_twenty_one_skip_link_focus_fix() {
    471 
    472     // If SCRIPT_DEBUG is defined and true, print the unminified file.
    473     if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
    474         echo '<script>';
    475         include get_template_directory() . '/assets/js/skip-link-focus-fix.js';
    476         echo '</script>';
    477     } else {
    478         // The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.
    479         ?>
    480         <script>
    481         /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
    482         </script>
    483         <?php
    484     }
     471    ?>
     472    <!-- <?php echo __FUNCTION__; ?>(): Internet Explorer support was removed. -->
     473    <?php
    485474}
    486475
Note: See TracChangeset for help on using the changeset viewer.