[wp-trac] [WordPress Trac] #24766: Title attributes galore. They serve no useful purpose.

WordPress Trac noreply at wordpress.org
Sat Apr 1 10:52:09 UTC 2017


#24766: Title attributes galore. They serve no useful purpose.
-------------------------------------------------+-------------------------
 Reporter:  karlgroves                           |       Owner:
     Type:  defect (bug)                         |      Status:  closed
 Priority:  lowest                               |   Milestone:  3.7
Component:  Accessibility                        |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  3.7-early has-patch needs-refresh    |     Focuses:
  title-attribute                                |
-------------------------------------------------+-------------------------
Changes (by afercia):

 * keywords:  3.7-early has-patch needs-refresh => 3.7-early has-patch
     needs-refresh title-attribute


Comment:

 To give an idea of the progress done and have some data for history, I've
 scanned the codebase from version 4.0 to 4.7. Searching for occurrences of
 ` title=` (space title equal) within `.php` files in the `wp-admin`
 directory, so this count leaves out title attributes in other files and
 the ones added via JavaScript:

 {{{
 4.0: 157 results found in 37 files
 4.1: 156 results found in 37 files
 4.2: 146 results found in 35 files
 4.3: 101 results found in 30 files
 4.4:  97 results found in 32 files
 4.5:  21 results found in 12 files
 4.6:  19 results found in 11 files
 4.7:  17 results found in  9 files
 }}}

 Checking the 17 title attributes in 4.7:
 - 4 are legit because they're used on `<iframe>` elements
 - 7 used in the `wp-admin/includes/class-wp-theme-install-list-table.php`
 file, as far as I know no more used by core
 - 1 used in the `wp-admin/includes/class-wp-themes-list-table.php` file,
 as far as I know no more used by core
 - 1 used in the Dashboard for the `Search Engines Discouraged` link and
 since 4.5.0 The default for `$title` was updated to an empty string


 That leaves us with 4 title attributes still candidate for removal:
 - 2 used for the Comments icon in the Posts and Media list tables header
 - 1 used in the Posts list table for the expanded post date
 - 1 used in the Bulk Edit form for the "X" icon in the list of the edited
 posts

 From 157 down to 4, not to mention many of these occurrences were within
 loops so the number of title attributes actually  output was higher. It
 would be really interesting to check if any complaints or usability
 regressions caused by the title attributes removal have ever been reported
 for the last 7 releases. Personally, I haven't heard any.

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


More information about the wp-trac mailing list