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
This commit is contained in:
Mark Jaquith 2015-07-02 00:47:24 +00:00
parent edffcb0bcd
commit cf38b016e8
4 changed files with 33 additions and 19 deletions

View File

@ -1438,7 +1438,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null
); );
$link = sprintf( "<a class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>", $link = sprintf( "<a class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
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, $onclick,
esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ), esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
$args['reply_text'] $args['reply_text']
@ -1571,9 +1571,10 @@ function get_cancel_comment_reply_link( $text = '' ) {
if ( empty($text) ) if ( empty($text) )
$text = __('Click here to cancel reply.'); $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 = '<a id="cancel-comment-reply-link" href="' . $link . '">' . $text . '</a>'; $formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
/** /**
* Filter the cancel comment reply link HTML. * Filter the cancel comment reply link HTML.
* *
@ -1609,8 +1610,9 @@ function get_comment_id_fields( $id = 0 ) {
if ( empty( $id ) ) if ( empty( $id ) )
$id = get_the_ID(); $id = get_the_ID();
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
$result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n"; $result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
$result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='0' />\n"; $result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
/** /**
* Filter the returned comment id fields. * Filter the returned comment id fields.
@ -1619,9 +1621,9 @@ function get_comment_id_fields( $id = 0 ) {
* *
* @param string $result The HTML-formatted hidden id field comment elements. * @param string $result The HTML-formatted hidden id field comment elements.
* @param int $id The post ID. * @param int $id The post ID.
* @param int $deprecated No longer used. * @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. * @param string $noreplytext Optional. Text to display when not replying to a comment.
* Default false. * Default false.
* @param string $deprecated No longer used. * @param string $replytext Optional. Text to display when replying to a comment.
* @param string $deprecated_2 No longer used. * 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 ) { function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
if ( ! is_null( $deprecated ) ) global $comment;
_deprecated_argument( __FUNCTION__, '4.3' );
if ( ! is_null( $deprecated_2 ) )
_deprecated_argument( __FUNCTION__, '4.3' );
if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
if ( 0 == $replytoid )
echo $noreplytext; echo $noreplytext;
else {
$comment = get_comment($replytoid);
$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
printf( $replytext, $author );
}
} }
/** /**
@ -2283,7 +2294,7 @@ function comment_form( $args = array(), $post_id = null ) {
do_action( 'comment_form_before' ); do_action( 'comment_form_before' );
?> ?>
<div id="respond" class="comment-respond"> <div id="respond" class="comment-respond">
<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> <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>
<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?> <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
<?php echo $args['must_log_in']; ?> <?php echo $args['must_log_in']; ?>
<?php <?php

View File

@ -231,6 +231,9 @@ add_action( 'init', 'check_theme_switched', 99 );
add_action( 'after_switch_theme', '_wp_sidebars_changed' ); add_action( 'after_switch_theme', '_wp_sidebars_changed' );
add_action( 'wp_print_styles', 'print_emoji_styles' ); add_action( 'wp_print_styles', 'print_emoji_styles' );
if ( isset( $_GET['replytocom'] ) )
add_action( 'wp_head', 'wp_no_robots' );
// Login actions // Login actions
add_action( 'login_head', 'wp_print_head_scripts', 9 ); add_action( 'login_head', 'wp_print_head_scripts', 9 );
add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); add_action( 'login_footer', 'wp_print_footer_scripts', 20 );

View File

@ -65,7 +65,7 @@ _deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.
<div id="respond"> <div id="respond">
<h3><?php _e('Leave a Reply'); ?></h3> <h3><?php comment_form_title( __('Leave a Reply'), __('Leave a Reply to %s' ) ); ?></h3>
<div id="cancel-comment-reply"> <div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small> <small><?php cancel_comment_reply_link() ?></small>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.