Accessibility: Change the posts "Quick Edit" link to a button.

For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation. Also,
adds an `aria-expanded` attribute to the button to communicate to assistive
technologies the expanded / collapsed status of the Quick Edit form.

Props Cheffheid, audrasjb, afercia.
Fixes #38677.


git-svn-id: https://develop.svn.wordpress.org/trunk@42725 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2018-02-21 22:30:34 +00:00
parent 9e31509293
commit c729ca4171
2 changed files with 13 additions and 9 deletions

View File

@@ -1267,7 +1267,7 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
__( 'Edit' )
);
$actions['inline hide-if-no-js'] = sprintf(
'<a href="#" class="editinline" aria-label="%s">%s</a>',
'<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
/* translators: %s: post title */
esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),
__( 'Quick&nbsp;Edit' )