Ticket #7635: reply-to-comments-nojs.patch
| File reply-to-comments-nojs.patch, 4.2 KB (added by Viper007Bond, 4 years ago) |
|---|
-
wp-content/themes/default/comments.php
44 44 45 45 <div id="respond"> 46 46 47 <h3> Leave a Reply</h3>47 <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3> 48 48 49 <div id="cancel-comment-reply" style=" display: none;">49 <div id="cancel-comment-reply" style="<?php cancel_comment_style(); ?>"> 50 50 <small><?php echo cancel_comment_reply_link() ?></small> 51 51 </div> 52 52 … … 79 79 80 80 <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> 81 81 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> 82 < input type="hidden" name="comment_parent" id="comment-parent" value="0" />82 <?php parent_comment_id(); ?> 83 83 </p> 84 84 <?php do_action('comment_form', $post->ID); ?> 85 85 -
wp-includes/comment-template.php
899 899 $link = ''; 900 900 901 901 if ( get_option('comment_registration') && !$user_ID ) 902 $link = '<a href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';902 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>'; 903 903 else 904 $link = "<a href='#' onclick='moveAddCommentForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>";904 $link = "<a rel='nofollow' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#respond' onclick='moveAddCommentForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>"; 905 905 906 906 return $link; 907 907 } … … 918 918 function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') { 919 919 if ( empty($text) ) 920 920 $text = __('Click here to cancel reply.'); 921 echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>';921 echo '<a rel="nofollow" href="' . wp_specialchars( remove_query_arg('replytocom') ) . '#respond" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>'; 922 922 } 923 923 924 924 /** 925 * Output inline CSS for cancel comment reply link container. 926 * 927 * @since 2.7.0 928 */ 929 function cancel_comment_style() { 930 if ( empty($_GET['replytocom']) ) 931 echo 'display:none;'; 932 } 933 934 /** 935 * Output hidden input HTML for replying to comments. 936 * 937 * @since 2.7.0 938 */ 939 function parent_comment_id() { 940 $replytoid = (int) ( !empty($_GET['replytocom']) ) ? $_GET['replytocom'] : 0; 941 echo "<input type='hidden' name='comment_parent' id='comment-parent' value='$replytoid' />\n"; 942 } 943 944 /** 945 * Display text based on comment reply status. Only affects users with Javascript disabled. 946 * 947 * @since 2.7.0 948 * 949 * @param string $noreplytext Optional. Text to display when not replying to a comment. 950 * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. 951 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. 952 */ 953 function comment_form_title( $noreplytext = 'Leave a Reply', $replytext = 'Leave a Reply to %s', $linktoparent = TRUE ) { 954 global $comment; 955 956 $replytoid = (int) ( !empty($_GET['replytocom']) ) ? $_GET['replytocom'] : 0; 957 958 if ( 0 == $replytoid ) 959 echo $noreplytext; 960 else { 961 $comment = get_comment($replytoid); 962 $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author(); 963 printf( $replytext, $author ); 964 } 965 } 966 967 /** 925 968 * HTML comment list class. 926 969 * 927 970 * @package WordPress … … 1037 1080 1038 1081 <?php echo apply_filters('comment_text', get_comment_text()) ?> 1039 1082 1040 <div class="reply" style="display:none">1083 <div class="reply"> 1041 1084 <?php echo comment_reply_link(array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['depth'])) ?> 1042 1085 <?php if ( 'ul' == $args['style'] ) : ?> 1043 1086 </div>
