From cf38b016e8eddbdb8b68e60611b4a89d6680754f Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 2 Jul 2015 00:47:24 +0000 Subject: [PATCH] Revert [33038] because of objections raised on #22889 and #31590 Built from https://develop.svn.wordpress.org/trunk@33042 git-svn-id: http://core.svn.wordpress.org/trunk@33013 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 45 +++++++++++++++++---------- wp-includes/default-filters.php | 3 ++ wp-includes/theme-compat/comments.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 14105ace2a..26e2818b1d 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1438,7 +1438,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null ); $link = sprintf( "%s", - esc_url( get_permalink( $post->ID ) ) . "#" . $args['respond_id'], + esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'], $onclick, esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ), $args['reply_text'] @@ -1571,9 +1571,10 @@ function get_cancel_comment_reply_link( $text = '' ) { if ( empty($text) ) $text = __('Click here to cancel reply.'); - $link = '#respond'; + $style = isset($_GET['replytocom']) ? '' : ' style="display:none;"'; + $link = esc_html( remove_query_arg('replytocom') ) . '#respond'; - $formatted_link = '' . $text . ''; + $formatted_link = '' . $text . ''; /** * Filter the cancel comment reply link HTML. * @@ -1609,19 +1610,20 @@ function get_comment_id_fields( $id = 0 ) { if ( empty( $id ) ) $id = get_the_ID(); + $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; $result = "\n"; - $result .= "\n"; + $result .= "\n"; /** * Filter the returned comment id fields. * * @since 3.0.0 * - * @param string $result The HTML-formatted hidden id field comment elements. - * @param int $id The post ID. - * @param int $deprecated No longer used. + * @param string $result The HTML-formatted hidden id field comment elements. + * @param int $id The post ID. + * @param int $replytoid The id of the comment being replied to. */ - return apply_filters( 'comment_id_fields', $result, $id, 0 ); + return apply_filters( 'comment_id_fields', $result, $id, $replytoid ); } /** @@ -1646,18 +1648,27 @@ function comment_id_fields( $id = 0 ) { * * @param string $noreplytext Optional. Text to display when not replying to a comment. * Default false. - * @param string $deprecated No longer used. - * @param string $deprecated_2 No longer used. + * @param string $replytext Optional. Text to display when replying to a comment. + * Default false. Accepts "%s" for the author of the comment + * being replied to. + * @param string $linktoparent Optional. Boolean to control making the author's name a link + * to their comment. Default true. */ -function comment_form_title( $noreplytext = false, $deprecated = null, $deprecated_2 = null ) { - if ( ! is_null( $deprecated ) ) - _deprecated_argument( __FUNCTION__, '4.3' ); - if ( ! is_null( $deprecated_2 ) ) - _deprecated_argument( __FUNCTION__, '4.3' ); +function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) { + global $comment; if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); + if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' ); - echo $noreplytext; + $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; + + if ( 0 == $replytoid ) + echo $noreplytext; + else { + $comment = get_comment($replytoid); + $author = ( $linktoparent ) ? '' . get_comment_author() . '' : get_comment_author(); + printf( $replytext, $author ); + } } /** @@ -2283,7 +2294,7 @@ function comment_form( $args = array(), $post_id = null ) { do_action( 'comment_form_before' ); ?>
-

+

-

+

diff --git a/wp-includes/version.php b/wp-includes/version.php index 8cdbbbfa85..e30903b8fe 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-33041'; +$wp_version = '4.3-alpha-33042'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.