Accessibility: Change the comments "Quick Edit" and "Reply" links to buttons.
For better accessibility and semantics, user interface controls that perform an action should be buttons. Links should exclusively be used for navigation. Props Cheffeid, audrasjb, afercia. See #43382, #38677. Fixes #43376. Built from https://develop.svn.wordpress.org/trunk@42767 git-svn-id: http://core.svn.wordpress.org/trunk@42597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -635,7 +635,7 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
|
||||
if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
|
||||
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
|
||||
|
||||
$format = '<a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" aria-label="%s" href="#">%s</a>';
|
||||
$format = '<button type="button" data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s button-link" aria-expanded="false" aria-label="%s">%s</button>';
|
||||
|
||||
$actions['quickedit'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick edit this comment inline' ), __( 'Quick Edit' ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user