From 70c88e59b13a4e2de03621d28872ea4142bb667d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 2 Oct 2014 20:41:16 +0000 Subject: [PATCH] Add an aria-label attribute with commenter's name to get_comment_reply_link(). props joedolson, merty, andrewryno. fixes #16433. Built from https://develop.svn.wordpress.org/trunk@29822 git-svn-id: http://core.svn.wordpress.org/trunk@29588 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 76a0ee0ff9..026498821e 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1305,13 +1305,14 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c function get_comment_reply_link( $args = array(), $comment = null, $post = null ) { $defaults = array( - 'add_below' => 'comment', - 'respond_id' => 'respond', - 'reply_text' => __('Reply'), - 'login_text' => __('Log in to Reply'), - 'depth' => 0, - 'before' => '', - 'after' => '' + 'add_below' => 'comment', + 'respond_id' => 'respond', + 'reply_text' => __( 'Reply' ), + 'reply_to_text' => __( 'Reply to %s' ), + 'login_text' => __( 'Log in to Reply' ), + 'depth' => 0, + 'before' => '', + 'after' => '' ); $args = wp_parse_args( $args, $defaults ); @@ -1337,7 +1338,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { $link = '' . $args['login_text'] . ''; } else { - $link = "comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text"; + $link = "comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")' aria-label='" . esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ) . "'>$reply_text"; } /** * Filter the comment reply link.