[wp-trac] [WordPress Trac] #51299: Remove the title attribute from Walker_Nav_Menu

WordPress Trac noreply at wordpress.org
Thu Oct 8 17:51:28 UTC 2020


#51299: Remove the title attribute from Walker_Nav_Menu
-------------------------------------------------+-------------------------
 Reporter:  Hareesh Pillai                       |       Owner:  Hareesh
                                                 |  Pillai
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.6
Component:  Menus                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  title-attribute has-patch needs-     |     Focuses:
  dev-note                                       |  accessibility
-------------------------------------------------+-------------------------

Comment (by sabernhardt):

 For backward compatibility, I think a filter would fit better than using
 theme-support. If there is a reason to keep title attributes, that should
 carry over when switching themes.

 Suggested behavior:

 If the filter would return false,
 1. no title attributes output and
 2. the menus admin page does not show the input field for editing titles.

 If the filter is true (and/or customized), the nav menu would include the
 attributes
 1. when provided and
 2. when they do not match the link text (automatically removing when
 redundant).

 Adding the filter would only make sense if false is default, though. (If
 you know you don't want the attributes included, you can empty the input
 for each list item already.)

 Another possibility is following @williampatton's
 [https://wordpress.slack.com/archives/C02RP4X03/p1596278995258200 idea for
 deprecation in themes], so the change is established as opt-in for one
 release and then the default is switched in the next.

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


More information about the wp-trac mailing list