[wp-trac] [WordPress Trac] #17349: Missing title attribute in anchor tag

WordPress Trac wp-trac at lists.automattic.com
Mon May 9 16:53:18 UTC 2011

#17349: Missing title attribute in anchor tag
 Reporter:  ksantoshp                |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  3.1.2
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |

Comment (by ksantoshp):

 Here is the guidline http://www.w3.org/TR/WCAG20/ .

 @toscho I accept your point

 "Title attributes are useful for links withe the same anchor text and
 different targets".
 but still can we have option, through which I can add title attribute to
 <a> tag.
 I found one option in wp-includes/link-template.php on line number 1594
 and 1595 and code is as below

 $attr = apply_filters( 'next_posts_link_attributes', '' );
                 return '<a href="' . next_posts( $max_page, false ) . "\"
 $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label) .

 This code is to show pagination link "next".  I like the idea of $attr
 with filter. And I used it as below in my theme's function.php

 add_filter( 'next_posts_link_attributes', 'rt_next_posts_link_attributes'

 function rt_next_posts_link_attributes() {
     return ' title="next"';

 With above code I inserted title attibut for "next" link.

 My suggestion is that,  can we have $attr and filter combination for those
 anchor tags, where it really needed.

Ticket URL: <http://core.trac.wordpress.org/ticket/17349#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list