1314 | | 'add_below' => 'comment', |
1315 | | 'respond_id' => 'respond', |
1316 | | 'reply_text' => __( 'Reply' ), |
1317 | | 'reply_to_text' => __( 'Reply to %s' ), |
1318 | | 'login_text' => __( 'Log in to Reply' ), |
1319 | | 'depth' => 0, |
1320 | | 'before' => '', |
1321 | | 'after' => '' |
| 1314 | 'add_below' => 'comment', |
| 1315 | 'respond_id' => 'respond', |
| 1316 | 'reply_text' => __('Reply'), |
| 1317 | 'login_text' => __('Log in to Reply'), |
| 1318 | 'depth' => 0, |
| 1319 | 'before' => '', |
| 1320 | 'after' => '' |
1337 | | |
| 1334 | /** |
| 1335 | * Filter the comment reply link arguments. |
| 1336 | * |
| 1337 | * @since 4.1.0 |
| 1338 | * |
| 1339 | * @param array $args An array of arguments overriding the defaults. |
| 1340 | * @param object $comment The object of the comment being replied. |
| 1341 | * @param WP_Post $post The WP_Post object. |
| 1342 | */ |
| 1343 | $args = apply_filters( 'comment_reply_link_args', $args, $comment, $post ); |
| 1344 | |
| 1345 | $add_below = $args['add_below']; |
| 1346 | $respond_id = $args['respond_id']; |
| 1347 | $reply_text = $args['reply_text']; |
| 1348 | |
1348 | | $onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )', |
1349 | | $args['add_below'], $comment->comment_ID, $args['respond_id'], $post->ID |
1350 | | ); |
1351 | | |
1352 | | $link = sprintf( "<a class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>", |
1353 | | esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $args['respond_id'], |
1354 | | $onclick, |
1355 | | esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ), |
1356 | | $args['reply_text'] |
1357 | | ); |
| 1356 | $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>"; |