[wp-trac] [WordPress Trac] #55530: Category archive links include description in a title attribute by default

WordPress Trac noreply at wordpress.org
Mon Apr 11 23:08:04 UTC 2022


#55530: Category archive links include description in a title attribute by default
-------------------------------------------------+-------------------------
 Reporter:  just0nequestion                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Taxonomy                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch title-attribute good-    |     Focuses:
  first-bug                                      |  accessibility
-------------------------------------------------+-------------------------

Comment (by andrija):

 Hello @sabernhardt, I'd like to tackle this as my first bug.

 Can you help me brainstorm the best solution, please?

 Currently, the default value of `use_desc_for_title` is 1.
 If I set it to 0, then the HTML <a> tag will have no `title` attribute at
 all.

 - Should we remove that default arg, then we'll never have the <a> `title`
 attribute
 - Should we change the behavior of ''\src\wp-includes\class-walker-
 category.php:125'' to simply use `$category->name` if `use_desc_for_title`
 is 1, but that simply sounds wrong
 - Should we add an `} else {` there so we always have the `title`
 attribute in the <a> tag, with the `$category->description` if
 `use_desc_for_title` is 1 and `$category->name` if `use_desc_for_title` is
 0

 I guess the last solution would work, what do you think?

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


More information about the wp-trac mailing list