diff --git a/wp-content/themes/twentytwentyone/assets/js/skip-link-focus-fix.js b/wp-content/themes/twentytwentyone/assets/js/skip-link-focus-fix.js index 5ae1338dc8..c74a831adf 100644 --- a/wp-content/themes/twentytwentyone/assets/js/skip-link-focus-fix.js +++ b/wp-content/themes/twentytwentyone/assets/js/skip-link-focus-fix.js @@ -1,35 +1 @@ -/** - * File skip-link-focus-fix.js. - * - * Helps with accessibility for keyboard only users. - * - * This is the source file for what is minified in the twenty_twenty_one_skip_link_focus_fix() PHP function. - * - * Learn more: https://git.io/vWdr2 - * - * @since Twenty Twenty-One 1.0 - */ -( function() { - var isIe = /(trident|msie)/i.test( navigator.userAgent ); - - if ( isIe && document.getElementById && window.addEventListener ) { - window.addEventListener( 'hashchange', function() { - var id = location.hash.substring( 1 ), - element; - - if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { - return; - } - - element = document.getElementById( id ); - - if ( element ) { - if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { - element.tabIndex = -1; - } - - element.focus(); - } - }, false ); - } -}() ); +// Internet Explorer support was removed. diff --git a/wp-content/themes/twentytwentyone/functions.php b/wp-content/themes/twentytwentyone/functions.php index 052ee1c5ea..01a97e597e 100644 --- a/wp-content/themes/twentytwentyone/functions.php +++ b/wp-content/themes/twentytwentyone/functions.php @@ -457,31 +457,20 @@ function twentytwentyone_block_editor_script() { add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' ); /** - * Fixes skip link focus in IE11. + * Adds an HTML comment about the lack of Internet Explorer support. * - * This does not enqueue the script because it is tiny and because it is only for IE11, - * thus it does not warrant having an entire dedicated blocking script being loaded. + * This originally printed a script to fix the skip link focus behavior in IE11. * * @since Twenty Twenty-One 1.0 * @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action. + * @deprecated Twenty Twenty-One 2.8 Removed Internet Explorer support. * * @link https://git.io/vWdr2 */ function twenty_twenty_one_skip_link_focus_fix() { - - // If SCRIPT_DEBUG is defined and true, print the unminified file. - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - echo ''; - } else { - // The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`. - ?> - - + +