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