Changes from branches/3.0/wp-includes/comment-template.php at r15434 to trunk/wp-includes/comment-template.php at r17071
- File:
-
- 1 edited
-
trunk/wp-includes/comment-template.php (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r15434 r17071 163 163 * @see get_comment_author_link() Echoes result 164 164 * 165 * @param int The ID of the comment for which to print the author's link. Optional.165 * @param int $comment_ID The ID of the comment for which to print the author's link. Optional. 166 166 */ 167 167 function comment_author_link( $comment_ID = 0 ) { … … 546 546 */ 547 547 function get_comments_number( $post_id = 0 ) { 548 global $id; 549 $post_id = (int) $post_id; 548 $post_id = absint( $post_id ); 550 549 551 550 if ( !$post_id ) 552 $post_id = (int) $id;551 $post_id = get_the_ID(); 553 552 554 553 $post = get_post($post_id); … … 565 564 * 566 565 * @since 0.71 567 * @uses $id568 566 * @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively. 569 567 * … … 574 572 */ 575 573 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 576 global $id;577 578 574 if ( !empty( $deprecated ) ) 579 575 _deprecated_argument( __FUNCTION__, '1.3' ); 580 576 581 $number = get_comments_number( $id);577 $number = get_comments_number(); 582 578 583 579 if ( $number > 1 ) … … 602 598 function get_comment_text( $comment_ID = 0 ) { 603 599 $comment = get_comment( $comment_ID ); 604 return apply_filters( 'get_comment_text', $comment->comment_content);600 return apply_filters( 'get_comment_text', $comment->comment_content, $comment ); 605 601 } 606 602 … … 615 611 */ 616 612 function comment_text( $comment_ID = 0 ) { 617 echo apply_filters('comment_text', get_comment_text() ); 613 $comment = get_comment( $comment_ID ); 614 echo apply_filters( 'comment_text', get_comment_text( $comment_ID ), $comment ); 618 615 } 619 616 … … 679 676 */ 680 677 function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) { 681 if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );682 if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );683 if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );678 if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' ); 679 if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' ); 680 if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' ); 684 681 $type = get_comment_type(); 685 682 switch( $type ) { … … 704 701 * @since 1.5.0 705 702 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL 706 * @uses $id707 703 * 708 704 * @return string The trackback URL after being filtered 709 705 */ 710 706 function get_trackback_url() { 711 global $id;712 707 if ( '' != get_option('permalink_structure') ) { 713 708 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); 714 709 } else { 715 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;710 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID(); 716 711 } 717 712 return apply_filters('trackback_url', $tb_url); … … 748 743 if ( !empty( $deprecated ) ) 749 744 _deprecated_argument( __FUNCTION__, '2.5' ); 745 746 if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') ) 747 return; 750 748 751 749 echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" … … 842 840 * @global array $comment List of comment objects for the current post 843 841 * @uses $wpdb 844 * @uses $id845 842 * @uses $post 846 843 * @uses $withcomments Will not try to get the comments if the post has none. … … 959 956 * 960 957 * @since 0.71 961 * @uses $id962 958 * @uses $wpcommentspopupfile 963 959 * @uses $wpcommentsjavascript … … 972 968 */ 973 969 function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { 974 global $id, $wpcommentspopupfile, $wpcommentsjavascript; 975 976 if ( false === $zero ) $zero = __( 'No Comments' ); 977 if ( false === $one ) $one = __( '1 Comment' ); 978 if ( false === $more ) $more = __( '% Comments' ); 979 if ( false === $none ) $none = __( 'Comments Off' ); 970 global $wpcommentspopupfile, $wpcommentsjavascript; 971 972 $id = get_the_ID(); 973 974 if ( false === $zero ) $zero = __( 'No Comments' ); 975 if ( false === $one ) $one = __( '1 Comment' ); 976 if ( false === $more ) $more = __( '% Comments' ); 977 if ( false === $none ) $none = __( 'Comments Off' ); 980 978 981 979 $number = get_comments_number( $id ); … … 1062 1060 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>'; 1063 1061 else 1064 $link = "<a rel='nofollow'class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";1062 $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 1065 1063 return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post); 1066 1064 } … … 1166 1164 */ 1167 1165 function get_comment_id_fields() { 1168 global $id;1166 $id = get_the_ID(); 1169 1167 1170 1168 $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; … … 1215 1213 * @package WordPress 1216 1214 * @uses Walker 1217 * @since unknown1215 * @since 2.7.0 1218 1216 */ 1219 1217 class Walker_Comment extends Walker { 1220 1218 /** 1221 1219 * @see Walker::$tree_type 1222 * @since unknown1220 * @since 2.7.0 1223 1221 * @var string 1224 1222 */ … … 1227 1225 /** 1228 1226 * @see Walker::$db_fields 1229 * @since unknown1227 * @since 2.7.0 1230 1228 * @var array 1231 1229 */ … … 1234 1232 /** 1235 1233 * @see Walker::start_lvl() 1236 * @since unknown1234 * @since 2.7.0 1237 1235 * 1238 1236 * @param string $output Passed by reference. Used to append additional content. … … 1258 1256 /** 1259 1257 * @see Walker::end_lvl() 1260 * @since unknown1258 * @since 2.7.0 1261 1259 * 1262 1260 * @param string $output Passed by reference. Used to append additional content. … … 1321 1319 /** 1322 1320 * @see Walker::start_el() 1323 * @since unknown1321 * @since 2.7.0 1324 1322 * 1325 1323 * @param string $output Passed by reference. Used to append additional content. … … 1357 1355 </div> 1358 1356 <?php if ($comment->comment_approved == '0') : ?> 1359 <em ><?php _e('Your comment is awaiting moderation.') ?></em>1357 <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em> 1360 1358 <br /> 1361 1359 <?php endif; ?> … … 1381 1379 /** 1382 1380 * @see Walker::end_el() 1383 * @since unknown1381 * @since 2.7.0 1384 1382 * 1385 1383 * @param string $output Passed by reference. Used to append additional content.
Note: See TracChangeset
for help on using the changeset viewer.