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

WordPress Trac noreply at wordpress.org
Wed Jun 3 13:28:53 UTC 2020


#24766: Title attributes galore. They serve no useful purpose.
---------------------------------------+--------------------------------
 Reporter:  karlgroves                 |       Owner:  (none)
     Type:  task (blessed)             |      Status:  reopened
 Priority:  normal                     |   Milestone:  Future Release
Component:  Administration             |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  title-attribute a11y-task  |     Focuses:  ui, accessibility
---------------------------------------+--------------------------------

Old description:

> This is a full list of methods, including what files they're from, where
> HTML title attributes are in use.
>
> The title attribute provides a tooltip on certain browsers. Other than
> that, it is essentially useless.  As provided in WordPress, the title
> attribute is both redundant and useless, because in most cases, it is a
> complete duplicate of the link's text. Therefore the tooltip provided is
> of no value whatsoever.
>
> For users of assistive technologies, the title attribute is useless at
> best and sometimes an annoyance. Users of text-to-speech software who
> have configured their software to do so will hear the title attribute
> twice.
>
> Essentially the extensive use of title attributes throughout Wordpress
> Core amounts to unnecessary code bloat.
>
> I recommend eliminating the title attributes from all of the methods
> below:
>
> {{{
> // user.php
> wp_authenticate_username_password()
>

> // post-template.php
> wp_page_menu()
> wp_get_attachment_link()
>
> // media.php
> get_image_tag()
>
> // media-template.php
> wp_print_media_templates()
>
> // link-template.php
> edit_term_link()
> edit_post_link()
> edit_comment_link()
> edit_bookmark_link()
> get_adjacent_post_rel_link()
> the_shortlink()
>
> // default-widgets.php
> widget()
>
> // comment-template.php
> comments_popup_link()
> comment_form()
>
> // class-wp-theme.php
> markup_header()
>
> // class-wp-editor.php
> wp_fullscreen_html(). There is one title attribute here on what I think
> is a TinyMCE button. If that looks like a button, it should actually be a
> button.
>
> // class-wp-customize-section.php
> render()
>
> // category-template.php
> get_category_parents()
> get_the_category_list()
> wp_generate_tag_cloud()
> start_el()
>
> // bookmark-template.php
> _walk_bookmarks()
>
> // author-template.php
> get_the_author_link()
> the_author_posts_link()
> wp_list_authors()
>
> // rss.php
> wp_rss()
> get_rss()
>
> // general-template.php
> get_calendar()
>
> // class-wp-admin-bar.php
> _render_item()
> }}}
>
> * Note:
> Ignored: All Third party classes

New description:

 This is a full list of methods, including what files they're from, where
 HTML title attributes are in use.

 The title attribute provides a tooltip on certain browsers. Other than
 that, it is essentially useless.  As provided in WordPress, the title
 attribute is both redundant and useless, because in most cases, it is a
 complete duplicate of the link's text. Therefore the tooltip provided is
 of no value whatsoever.

 For users of assistive technologies, the title attribute is useless at
 best and sometimes an annoyance. Users of text-to-speech software who have
 configured their software to do so will hear the title attribute twice.

 Essentially the extensive use of title attributes throughout WordPress
 Core amounts to unnecessary code bloat.

 I recommend eliminating the title attributes from all of the methods
 below:

 {{{
 // user.php
 wp_authenticate_username_password()


 // post-template.php
 wp_page_menu()
 wp_get_attachment_link()

 // media.php
 get_image_tag()

 // media-template.php
 wp_print_media_templates()

 // link-template.php
 edit_term_link()
 edit_post_link()
 edit_comment_link()
 edit_bookmark_link()
 get_adjacent_post_rel_link()
 the_shortlink()

 // default-widgets.php
 widget()

 // comment-template.php
 comments_popup_link()
 comment_form()

 // class-wp-theme.php
 markup_header()

 // class-wp-editor.php
 wp_fullscreen_html(). There is one title attribute here on what I think is
 a TinyMCE button. If that looks like a button, it should actually be a
 button.

 // class-wp-customize-section.php
 render()

 // category-template.php
 get_category_parents()
 get_the_category_list()
 wp_generate_tag_cloud()
 start_el()

 // bookmark-template.php
 _walk_bookmarks()

 // author-template.php
 get_the_author_link()
 the_author_posts_link()
 wp_list_authors()

 // rss.php
 wp_rss()
 get_rss()

 // general-template.php
 get_calendar()

 // class-wp-admin-bar.php
 _render_item()
 }}}

 * Note:
 Ignored: All Third party classes

--

Comment (by afercia):

 Update: [47879] removed the title attribute used in the Posts list table
 for the expanded post date.

 That leaves us with 16 occurrences of `title` attribute in the `wp-admin`
 directory. As mentioned in comment:47, some of them are legitimate and
 others are unused. Still to do:

 - 2 title attributes used for the Comments icon in the Posts and Media
 list tables header
 - 1 title attribute used in the Bulk Edit form for the "X" icon in the
 list of the edited posts, see #35483
 - the whole `wp-includes` directory: only one ticket so far, see #26562
 - title attributes in the various JavaScript files
 - title attributes in the bundled themes

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


More information about the wp-trac mailing list