diff --git src/wp-includes/comment-template.php src/wp-includes/comment-template.php
index 26e2818..8f34b3e 100644
|
|
function get_comment_reply_link( $args = array(), $comment = null, $post = null |
1438 | 1438 | ); |
1439 | 1439 | |
1440 | 1440 | $link = sprintf( "<a class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>", |
1441 | | esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'], |
| 1441 | esc_url( get_permalink( $post->ID ) ) . "#" . $args['respond_id'], |
1442 | 1442 | $onclick, |
1443 | 1443 | esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ), |
1444 | 1444 | $args['reply_text'] |
… |
… |
function get_cancel_comment_reply_link( $text = '' ) { |
1571 | 1571 | if ( empty($text) ) |
1572 | 1572 | $text = __('Click here to cancel reply.'); |
1573 | 1573 | |
1574 | | $style = isset($_GET['replytocom']) ? '' : ' style="display:none;"'; |
1575 | | $link = esc_html( remove_query_arg('replytocom') ) . '#respond'; |
| 1574 | $link = '#respond'; |
1576 | 1575 | |
1577 | | $formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>'; |
| 1576 | $formatted_link = '<a id="cancel-comment-reply-link" href="' . $link . '">' . $text . '</a>'; |
1578 | 1577 | /** |
1579 | 1578 | * Filter the cancel comment reply link HTML. |
1580 | 1579 | * |
… |
… |
function get_comment_id_fields( $id = 0 ) { |
1610 | 1609 | if ( empty( $id ) ) |
1611 | 1610 | $id = get_the_ID(); |
1612 | 1611 | |
1613 | | $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; |
1614 | 1612 | $result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n"; |
1615 | | $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n"; |
| 1613 | $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='0' />\n"; |
1616 | 1614 | |
1617 | 1615 | /** |
1618 | 1616 | * Filter the returned comment id fields. |
1619 | 1617 | * |
1620 | 1618 | * @since 3.0.0 |
1621 | 1619 | * |
1622 | | * @param string $result The HTML-formatted hidden id field comment elements. |
1623 | | * @param int $id The post ID. |
1624 | | * @param int $replytoid The id of the comment being replied to. |
| 1620 | * @param string $result The HTML-formatted hidden id field comment elements. |
| 1621 | * @param int $id The post ID. |
| 1622 | * @param int $deprecated No longer used. |
1625 | 1623 | */ |
1626 | | return apply_filters( 'comment_id_fields', $result, $id, $replytoid ); |
| 1624 | return apply_filters( 'comment_id_fields', $result, $id, 0 ); |
1627 | 1625 | } |
1628 | 1626 | |
1629 | 1627 | /** |
… |
… |
function comment_id_fields( $id = 0 ) { |
1648 | 1646 | * |
1649 | 1647 | * @param string $noreplytext Optional. Text to display when not replying to a comment. |
1650 | 1648 | * Default false. |
1651 | | * @param string $replytext Optional. Text to display when replying to a comment. |
1652 | | * Default false. Accepts "%s" for the author of the comment |
1653 | | * being replied to. |
1654 | | * @param string $linktoparent Optional. Boolean to control making the author's name a link |
1655 | | * to their comment. Default true. |
| 1649 | * @param string $deprecated No longer used. |
| 1650 | * @param string $deprecated_2 No longer used. |
1656 | 1651 | */ |
1657 | | function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) { |
1658 | | global $comment; |
| 1652 | function comment_form_title( $noreplytext, $deprecated = null, $deprecated_2 = null ) { |
| 1653 | if ( ! is_null( $deprecated ) ) |
| 1654 | _deprecated_argument( __FUNCTION__, '4.3' ); |
| 1655 | if ( ! is_null( $deprecated_2 ) ) |
| 1656 | _deprecated_argument( __FUNCTION__, '4.3' ); |
1659 | 1657 | |
1660 | 1658 | if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); |
1661 | | if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' ); |
1662 | | |
1663 | | $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; |
1664 | 1659 | |
1665 | | if ( 0 == $replytoid ) |
1666 | | echo $noreplytext; |
1667 | | else { |
1668 | | $comment = get_comment($replytoid); |
1669 | | $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author(); |
1670 | | printf( $replytext, $author ); |
1671 | | } |
| 1660 | echo $noreplytext; |
1672 | 1661 | } |
1673 | 1662 | |
1674 | 1663 | /** |
… |
… |
function comment_form( $args = array(), $post_id = null ) { |
2294 | 2283 | do_action( 'comment_form_before' ); |
2295 | 2284 | ?> |
2296 | 2285 | <div id="respond" class="comment-respond"> |
2297 | | <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3> |
| 2286 | <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( $args['title_reply'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3> |
2298 | 2287 | <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?> |
2299 | 2288 | <?php echo $args['must_log_in']; ?> |
2300 | 2289 | <?php |
diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index b1f69ea..c9fc38c 100644
|
|
add_action( 'init', 'check_theme_switched', 99 ); |
231 | 231 | add_action( 'after_switch_theme', '_wp_sidebars_changed' ); |
232 | 232 | add_action( 'wp_print_styles', 'print_emoji_styles' ); |
233 | 233 | |
234 | | if ( isset( $_GET['replytocom'] ) ) |
235 | | add_action( 'wp_head', 'wp_no_robots' ); |
236 | | |
237 | 234 | // Login actions |
238 | 235 | add_action( 'login_head', 'wp_print_head_scripts', 9 ); |
239 | 236 | add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); |
diff --git src/wp-includes/theme-compat/comments.php src/wp-includes/theme-compat/comments.php
index d46c041..bf9d310 100644
|
|
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3. |
65 | 65 | |
66 | 66 | <div id="respond"> |
67 | 67 | |
68 | | <h3><?php comment_form_title( __('Leave a Reply'), __('Leave a Reply to %s' ) ); ?></h3> |
| 68 | <h3><?php _e('Leave a Reply'); ?></h3> |
69 | 69 | |
70 | 70 | <div id="cancel-comment-reply"> |
71 | 71 | <small><?php cancel_comment_reply_link() ?></small> |