Changeset 9112 for trunk/wp-includes/comment-template.php
- Timestamp:
- 10/09/2008 07:37:05 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r9093 r9112 909 909 910 910 if ( get_option('comment_registration') && !$user_ID ) 911 $link = '<a href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';911 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>'; 912 912 else 913 $link = "<a href='#' onclick='moveAddCommentForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>";913 $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>"; 914 914 915 915 return $before . $link . $after; … … 921 921 * @since 2.7.0 922 922 * 923 * @param string $text Optional. Text to display for cancel reply. 924 * @param string $respond_id Optional. HTML ID attribute for JS cancelCommentReply function. 925 * @param string $respond_root Optional. Second parameter for JS cancelCommentReply function. 926 */ 927 function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') { 923 * @param string $text Optional. Text to display for cancel reply link. 924 */ 925 function cancel_comment_reply_link($text = '') { 928 926 if ( empty($text) ) 929 927 $text = __('Click here to cancel reply.'); 930 echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>'; 928 929 $style = isset($_GET['replytocom']) ? '' : ' style="display:none;"'; 930 931 echo '<a rel="nofollow" id="cancel-comment-reply-link" href="' . wp_specialchars( remove_query_arg('replytocom') ) . '#respond"' . $style . '>' . $text . '</a>'; 932 } 933 934 /** 935 * Output hidden input HTML for replying to comments. 936 * 937 * @since 2.7.0 938 */ 939 function comment_parent_field() { 940 $replytoid = isset($_GET['replytocom']) ? (int) $_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 = isset($_GET['replytocom']) ? (int) $_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 } 931 965 } 932 966 … … 1047 1081 <?php echo apply_filters('comment_text', get_comment_text()) ?> 1048 1082 1049 <div class="reply" style="display:none">1083 <div class="reply"> 1050 1084 <?php echo comment_reply_link(array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['depth'])) ?> 1051 1085 <?php if ( 'ul' == $args['style'] ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.