Make WordPress Core

Opened 2 months ago

Last modified 2 days ago

#41859 new defect (bug)

Add aria-current to the paginated posts links output by wp_link_pages()

Reported by: afercia Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Themes Keywords: aria-current needs-patch
Focuses: accessibility Cc:


When using the <!--nextpage--> tag one or multiple times in post, wp_link_pages() generates pagination links for the post. In the set of pagination links, aria-current would help assistive technologies users orientate themselves and understand which the current active "page" is.

See also #40833 that introduced aria-current for in paginate_links(), typically used on archive pages for posts navigation.

The actual links markup gets generated by _wp_link_page(). Worth noting this markup could be improved also for other things, for example there's no "current" CSS class used on the active paeg number.

Themes usually add their own markup around the links to improve things a bit. For example, Twenty Seventeen uses this:

wp_link_pages( array(
	'before'      => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
	'after'       => '</div>',
	'link_before' => '<span class="page-number">',
	'link_after'  => '</span>',
) );

However, some improvements to the default output would be a nice improvement.

Change History (2)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.

2 days ago

#2 @afercia
2 days ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.0
Note: See TracTickets for help on using tickets.