[wp-trac] [WordPress Trac] #54054: Remove role="navigation" from the markup of the the_posts_pagination() function

WordPress Trac noreply at wordpress.org
Wed Sep 1 16:28:43 UTC 2021


#54054: Remove role="navigation" from the markup of the the_posts_pagination()
function
-------------------------+-----------------------------
 Reporter:  ilovewpcom   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  5.8
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 According to HTML5 documentation, adding role="navigation" to a <nav>
 element is unnecessary (and not permitted).
 It should be added to elements like <div> instead, when using the
 semantically correct <nav> is not possible.

 Meanwhile this is the HTML markup for the the_posts_pagination() function,
 which comes through the _navigation_markup() function in the /wp-includes
 /link-template.php file.

 {{{#!php
     $template = '
     <nav class="navigation %1$s" role="navigation" aria-label="%4$s">
         <h2 class="screen-reader-text">%2$s</h2>
         <div class="nav-links">%3$s</div>
     </nav>';
 }}}


 References:
 [https://developer.mozilla.org/en-
 US/docs/Web/Accessibility/ARIA/Roles/Navigation_Role]
 [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54054>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list