Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/comment-template.php

    r17071 r15434  
    163163 * @see get_comment_author_link() Echoes result
    164164 *
    165  * @param int $comment_ID The 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.
    166166 */
    167167function comment_author_link( $comment_ID = 0 ) {
     
    546546 */
    547547function get_comments_number( $post_id = 0 ) {
    548     $post_id = absint( $post_id );
     548    global $id;
     549    $post_id = (int) $post_id;
    549550
    550551    if ( !$post_id )
    551         $post_id = get_the_ID();
     552        $post_id = (int) $id;
    552553
    553554    $post = get_post($post_id);
     
    564565 *
    565566 * @since 0.71
     567 * @uses $id
    566568 * @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively.
    567569 *
     
    572574 */
    573575function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
     576    global $id;
     577
    574578    if ( !empty( $deprecated ) )
    575579        _deprecated_argument( __FUNCTION__, '1.3' );
    576580
    577     $number = get_comments_number();
     581    $number = get_comments_number($id);
    578582
    579583    if ( $number > 1 )
     
    598602function get_comment_text( $comment_ID = 0 ) {
    599603    $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);
    601605}
    602606
     
    611615 */
    612616function 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() );
    615618}
    616619
     
    676679 */
    677680function 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' );
    681684    $type = get_comment_type();
    682685    switch( $type ) {
     
    701704 * @since 1.5.0
    702705 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL
     706 * @uses $id
    703707 *
    704708 * @return string The trackback URL after being filtered
    705709 */
    706710function get_trackback_url() {
     711    global $id;
    707712    if ( '' != get_option('permalink_structure') ) {
    708713        $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
    709714    } 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;
    711716    }
    712717    return apply_filters('trackback_url', $tb_url);
     
    743748    if ( !empty( $deprecated ) )
    744749        _deprecated_argument( __FUNCTION__, '2.5' );
    745 
    746     if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )
    747         return;
    748750
    749751    echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     
    840842 * @global array $comment List of comment objects for the current post
    841843 * @uses $wpdb
     844 * @uses $id
    842845 * @uses $post
    843846 * @uses $withcomments Will not try to get the comments if the post has none.
     
    956959 *
    957960 * @since 0.71
     961 * @uses $id
    958962 * @uses $wpcommentspopupfile
    959963 * @uses $wpcommentsjavascript
     
    968972 */
    969973function 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' );
    978980
    979981    $number = get_comments_number( $id );
     
    10601062        $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
    10611063    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>";
    10631065    return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post);
    10641066}
     
    11641166 */
    11651167function get_comment_id_fields() {
    1166     $id = get_the_ID();
     1168    global $id;
    11671169
    11681170    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
     
    12131215 * @package WordPress
    12141216 * @uses Walker
    1215  * @since 2.7.0
     1217 * @since unknown
    12161218 */
    12171219class Walker_Comment extends Walker {
    12181220    /**
    12191221     * @see Walker::$tree_type
    1220      * @since 2.7.0
     1222     * @since unknown
    12211223     * @var string
    12221224     */
     
    12251227    /**
    12261228     * @see Walker::$db_fields
    1227      * @since 2.7.0
     1229     * @since unknown
    12281230     * @var array
    12291231     */
     
    12321234    /**
    12331235     * @see Walker::start_lvl()
    1234      * @since 2.7.0
     1236     * @since unknown
    12351237     *
    12361238     * @param string $output Passed by reference. Used to append additional content.
     
    12561258    /**
    12571259     * @see Walker::end_lvl()
    1258      * @since 2.7.0
     1260     * @since unknown
    12591261     *
    12601262     * @param string $output Passed by reference. Used to append additional content.
     
    13191321    /**
    13201322     * @see Walker::start_el()
    1321      * @since 2.7.0
     1323     * @since unknown
    13221324     *
    13231325     * @param string $output Passed by reference. Used to append additional content.
     
    13551357        </div>
    13561358<?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>
    13581360        <br />
    13591361<?php endif; ?>
     
    13791381    /**
    13801382     * @see Walker::end_el()
    1381      * @since 2.7.0
     1383     * @since unknown
    13821384     *
    13831385     * @param string $output Passed by reference. Used to append additional content.
Note: See TracChangeset for help on using the changeset viewer.