[wp-trac] [WordPress Trac] #60685: Keyboard focus order mismatch in adminbar in front-end

WordPress Trac noreply at wordpress.org
Sun Jun 23 22:07:27 UTC 2024


#60685: Keyboard focus order mismatch in adminbar in front-end
---------------------------------------------+----------------------------
 Reporter:  joedolson                        |       Owner:  joedolson
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.6
Component:  Toolbar                          |     Version:  3.3
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note commit  |     Focuses:  accessibility
---------------------------------------------+----------------------------

Comment (by joedolson):

 @sabernhardt Dev note for your review.

 In [58215], the search input on the front end admin bar is added at a
 different priority. It was previously inserted at priority 4, then floated
 to appear at the end of the admin bar. It is now inserted at priority
 9999, to load at the end of the admin bar without CSS manipulation.

 Extenders placing admin bar nodes after the search or replacing core
 search should take the new priority into consideration.

 ### Assign different priority based on WordPress version

 {{{
 $priority = ( version_compare( $GLOBALS['wp_version'], '6.6', '>=' ) ) ? 4
 : 9999;
 add_action( 'admin_bar_menu', 'wpadmin_toolbar_test_link', $priority );
 /**
  * Add a node to the WP admin toolbar.
  *
  * @param object $wp_admin_bar WP Admin Bar object.
  */
 function wpadmin_toolbar_test_link( $wp_admin_bar ) {
         $wp_admin_bar->add_node(
                 array(
                         'parent' => 'top-secondary',
                         'id'     => 'mylink',
                         'href'   => '#',
                         'title'  => __( 'My Link' ),
                 )
         );
 }
 }}}

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


More information about the wp-trac mailing list