WordPress.org

Make WordPress Core

Ticket #37650: 37650.diff

File 37650.diff, 4.7 KB (added by trepmal, 3 years ago)
  • wp-includes/comment-template.php

     
    15681568 * @param array $args {
    15691569 *     Optional. Override default arguments.
    15701570 *
    1571  *     @type string $add_below  The first part of the selector used to identify the comment to respond below.
    1572  *                              The resulting value is passed as the first parameter to addComment.moveForm(),
    1573  *                              concatenated as $add_below-$comment->comment_ID. Default 'comment'.
    1574  *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
    1575  *                              to addComment.moveForm(), and appended to the link URL as a hash value.
    1576  *                              Default 'respond'.
    1577  *     @type string $reply_text The text of the Reply link. Default 'Reply'.
    1578  *     @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'.
    1579  *     @type int    $depth'     The depth of the new comment. Must be greater than 0 and less than the value
    1580  *                              of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.
    1581  *     @type string $before     The text or HTML to add before the reply link. Default empty.
    1582  *     @type string $after      The text or HTML to add after the reply link. Default empty.
     1571 *     @type string $add_below     The first part of the selector used to identify the comment to respond below.
     1572 *                                 The resulting value is passed as the first parameter to addComment.moveForm(),
     1573 *                                 concatenated as $add_below-$comment->comment_ID. Default 'comment'.
     1574 *     @type string $respond_id    The selector identifying the responding comment. Passed as the third parameter
     1575 *                                 to addComment.moveForm(), and appended to the link URL as a hash value.
     1576 *                                 Default 'respond'.
     1577 *     @type string $reply_text    The text of the Reply link. Default 'Reply'.
     1578 *     @type string $reply_to_text The aria-label attribute of the Reply link. Default 'Reply to %s'.
     1579 *     @type string $reply_title   The title attribute of the Reply link. Default '' (empty).
     1580 *     @type string $login_text    The text of the link to reply if logged out. Default 'Log in to Reply'.
     1581 *     @type string $login_title   The title attribute of the link if logged out. Default '' (empty).
     1582 *     @type int    $depth'        The depth of the new comment. Must be greater than 0 and less than the value
     1583 *                                 of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.
     1584 *     @type string $before        The text or HTML to add before the reply link. Default empty.
     1585 *     @type string $after         The text or HTML to add after the reply link. Default empty.
    15831586 * }
    15841587 * @param int|WP_Comment $comment Comment being replied to. Default current comment.
    15851588 * @param int|WP_Post    $post    Post ID or WP_Post object the comment is going to be displayed on.
     
    15921595                'respond_id'    => 'respond',
    15931596                'reply_text'    => __( 'Reply' ),
    15941597                'reply_to_text' => __( 'Reply to %s' ),
     1598                'reply_title'   => '',
    15951599                'login_text'    => __( 'Log in to Reply' ),
     1600                'login_title'   => '',
    15961601                'depth'         => 0,
    15971602                'before'        => '',
    15981603                'after'         => ''
     
    16291634        $args = apply_filters( 'comment_reply_link_args', $args, $comment, $post );
    16301635
    16311636        if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
    1632                 $link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
     1637                $link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%1$s" title="%3$s">%2$s</a>',
    16331638                        esc_url( wp_login_url( get_permalink() ) ),
    1634                         $args['login_text']
     1639                        $args['login_text'],
     1640                        $args['login_title']
    16351641                );
    16361642        } else {
    16371643                $onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )',
     
    16381644                        $args['add_below'], $comment->comment_ID, $args['respond_id'], $post->ID
    16391645                );
    16401646
    1641                 $link = sprintf( "<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
     1647                $link = sprintf( "<a rel='nofollow' class='comment-reply-link' href='%1\$s' onclick='%2\$s' aria-label='%3\$s' title='%5\$s'>%4\$s</a>",
    16421648                        esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'],
    16431649                        $onclick,
    16441650                        esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
    1645                         $args['reply_text']
     1651                        $args['reply_text'],
     1652                        $args['reply_title']
    16461653                );
    16471654        }
    16481655