[wp-trac] [WordPress Trac] #41859: Add aria-current to the paginated posts links output by wp_link_pages()

WordPress Trac noreply at wordpress.org
Sun Dec 10 19:06:42 UTC 2017


#41859: Add aria-current to the paginated posts links output by wp_link_pages()
------------------------------------+----------------------------
 Reporter:  afercia                 |       Owner:  afercia
     Type:  defect (bug)            |      Status:  assigned
 Priority:  normal                  |   Milestone:  5.0
Component:  Themes                  |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  aria-current has-patch  |     Focuses:  accessibility
------------------------------------+----------------------------
Changes (by afercia):

 * keywords:  aria-current dev-feedback has-patch => aria-current has-patch


Comment:

 @antonioeatgoat thanks for the patch and @alexstine thanks for testing!

 A few things:
 - there should be a `@since` notation for the new `aria_current` argument,
 as done for example in https://core.trac.wordpress.org/changeset/41371
 - I wouldn't change the default paragraph tag in a div, this might produce
 some layout/css breakage for themes that expect a paragraph
 - to avoid `str_replace()`, what about to add the CSS class in the private
 function `_wp_link_page()`? Seems the simplest solution to me, then add
 the same CSS class in the new span element
 - I'd use a `page-link` name for the CSS class, to avoid conflicts
 - maybe use `===` instead of `==` to compare the index with the page
 number?
 - in `tests/phpunit/tests/post/template.php` there are a few tests to
 update, this can also be done later :)

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


More information about the wp-trac mailing list