Make WordPress Core

Changeset 29822


Ignore:
Timestamp:
10/02/2014 08:40:35 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Add an aria-label attribute with commenter's name to get_comment_reply_link().

props joedolson, merty, andrewryno.
fixes #16433.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r29809 r29822  
    13061306
    13071307        $defaults = array(
    1308                 'add_below'  => 'comment',
    1309                 'respond_id' => 'respond',
    1310                 'reply_text' => __('Reply'),
    1311                 'login_text' => __('Log in to Reply'),
    1312                 'depth'      => 0,
    1313                 'before'     => '',
    1314                 'after'      => ''
     1308                'add_below'     => 'comment',
     1309                'respond_id'    => 'respond',
     1310                'reply_text'    => __( 'Reply' ),
     1311                'reply_to_text' => __( 'Reply to %s' ),
     1312                'login_text'    => __( 'Log in to Reply' ),
     1313                'depth'         => 0,
     1314                'before'        => '',
     1315                'after'         => ''
    13151316        );
    13161317
    … …  
    13381339                $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $args['login_text'] . '</a>';
    13391340        } else {
    1340                 $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     1341                $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->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</a>";
    13411342        }
    13421343        /**
Note: See TracChangeset for help on using the changeset viewer.