[wp-trac] [WordPress Trac] #54421: Deprecate skip link focus fix

WordPress Trac noreply at wordpress.org
Thu Nov 11 18:46:21 UTC 2021


#54421: Deprecate skip link focus fix
-------------------------+-------------------------------------------------
 Reporter:  westonruter  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  low          |   Milestone:  Awaiting Review
Component:  Bundled      |     Version:
  Theme                  |
 Severity:  trivial      |  Resolution:
 Keywords:               |     Focuses:  accessibility, javascript,
                         |  performance
-------------------------+-------------------------------------------------

Comment (by westonruter):

 Replying to [comment:1 joedolson]:
 > So while in general I support the idea of removing these scripts for
 most sites, I think it should be fairly easy to re-implement them.

 Yes, and it should still be so. In Twenty Twenty, for example, the change
 I'd suggest is:

 {{{#!diff
 --- a/src/wp-content/themes/twentytwenty/functions.php
 +++ b/src/wp-content/themes/twentytwenty/functions.php
 @@ -232,6 +232,7 @@ add_action( 'wp_enqueue_scripts',
 'twentytwenty_register_scripts' );
   * thus it does not warrant having an entire dedicated blocking script
 being loaded.
   *
   * @since Twenty Twenty 1.0
 + * @deprecated IE11 global usage is at 0.5% so it is no longer warranted
 for all visitors.
   *
   * @link https://git.io/vWdr2
   */
 @@ -243,7 +244,6 @@ function twentytwenty_skip_link_focus_fix() {
         </script>
         <?php
  }
 -add_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix'
 );

  /**
   * Enqueue non-latin language styles.
 }}}


 So if a specific site wants to re-implement the skip link focus fix, all
 they have to do is create a child theme or add a plugin with a single
 line:

 {{{#!php
 <?php
 add_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix'
 );
 }}}

 > Possibly use feature detection to load these only in IE?

 Unfortunately page caching will often break user agent detection, so this
 isn't really feasible.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54421#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list