Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#30939 closed enhancement (wontfix)

Missing title attribute in anchor tag in function start_el

Reported by: sireneweb's profile sireneweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Posts, Post Types Keywords: 2nd-opinion
Focuses: accessibility, template Cc:

Description

From usability point of view and as per WCAG guideline, each anchor tag should have title attribute.
In few of wordpress core files there are few anchor tag markup, which missed this title attribute.
For example in wp-includes/post-template.php file on line number 1345, there is code as below:

/** This filter is documented in wp-includes/post-template.php */
		$output .= $indent . sprintf(
			'<li class="%s"><a href="%s">%s%s%s</a>',
			$css_classes,
			get_permalink( $page->ID ),
			$args['link_before'],
			apply_filters( 'the_title', $page->post_title, $page->ID ),
			$args['link_after']
		);
/** This filter is documented in wp-includes/post-template.php */
		$output .= $indent . sprintf(
			'<li class="%s"><a href="%s" title="%s">%s%s%s</a>',
			$css_classes,
			get_permalink( $page->ID ),
			apply_filters( 'the_title', $page->post_title, $page->ID ),
			$args['link_before'],
			apply_filters( 'the_title', $page->post_title, $page->ID ),
			$args['link_after']
		);

Change History (7)

#1 @pento
11 years ago

  • Component changed from General to Posts, Post Types
  • Focuses accessibility template added
  • Keywords 2nd-opinion added
  • Version changed from 4.1 to 3.3

Thanks for the bug report, @sireneweb!

This was originally removed in #16783. Our accessibility experts may have some input on the best way to handle this.

#2 @rianrietveld
11 years ago

@sireneweb could you please give a link to the WCAG guideline where using a title attribute mentioned? I can't find it and for good accessibility practice all title attributes are removed from core. Screen readers omit them, and they serve no practical use other than a tooltip for desktop views.

Adding extra information using a title attribute also has the risk that you add extra information to a link, different from the content of the link, and then screen reader users miss the extra information.

I follow these advices:

#3 @sireneweb
11 years ago

@rianrietveld,
maybe add a filter would be better solution to add attribute like title. I understand your position, attribute as title can be benefit to improve accessibility for deficient users.

W3C say: setting the attribute on a link allows user agents (visual and non-visual) to tell users about the nature of the linked resource.

Personnaly, i add title attributes for improve SEO and accessibility (think screen reader software). Now i prefer use filter instead Jquery code because for SEO, google doesn't take into account the elements added by javascript.

Last edited 11 years ago by sireneweb (previous) (diff)

#4 @rianrietveld
11 years ago

I've been digging deeper into this:

In the HTML5 specifications it is specifically discouraged to use a title attribute.

http://www.w3.org/TR/html51/dom.html#the-title-attribute

Quote: Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g. requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

It is mentioned as a technique in
http://www.w3.org/TR/WCAG20-TECHS/H33.html as you refer to, but it is discouraged to use.

Don't focus on a technique, but focus on the usability for your users. H33 is a WCAG technique, not a requirement.

Using a title attribute is not concerned good accessibly or usability practice.
Most screen readers do not read a title attribute at all, for accessibility it's useless.

#5 @sireneweb
11 years ago

@rianrietveld,
thanks for your feedback, you can close the ticket i think

#6 @obenland
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks for bringing it up, sireneweb!

#7 @rianrietveld
11 years ago

@sireneweb yes, thanks for bringing it up and joining the discussion on how to make WordPress more accessible :-)

Last edited 11 years ago by rianrietveld (previous) (diff)
Note: See TracTickets for help on using tickets.