~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-includes/comment-template.php

  • Committer: Chris Jones
  • Date: 2010-01-19 13:17:33 UTC
  • Revision ID: cmsj@tenshu.net-20100119131733-rf31jv9k1v0xzo2h
[CJ] Import wordpress 2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
532
532
        else
533
533
                $count = $post->comment_count;
534
534
 
535
 
        return apply_filters('get_comments_number', $count);
 
535
        return apply_filters('get_comments_number', $count, $post_id);
536
536
}
537
537
 
538
538
/**
599
599
 */
600
600
function get_comment_time( $d = '', $gmt = false, $translate = true ) {
601
601
        global $comment;
602
 
        $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date;
 
602
        $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
603
603
        if ( '' == $d )
604
604
                $date = mysql2date(get_option('time_format'), $comment_date, $translate);
605
605
        else
606
606
                $date = mysql2date($d, $comment_date, $translate);
607
 
        return apply_filters('get_comment_time', $date, $d, $gmt);
 
607
        return apply_filters('get_comment_time', $date, $d, $gmt, $translate);
608
608
}
609
609
 
610
610
/**
813
813
function comments_template( $file = '/comments.php', $separate_comments = false ) {
814
814
        global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
815
815
 
816
 
        if ( ! (is_single() || is_page() || $withcomments) )
 
816
        if ( !(is_single() || is_page() || $withcomments) || empty($post) )
817
817
                return;
818
818
 
819
819
        if ( empty($file) )
835
835
 
836
836
        /**
837
837
         * The email address of the current comment author escaped for use in attributes.
838
 
         */     
 
838
         */
839
839
        $comment_author_email = $commenter['comment_author_email'];  // Escaped by sanitize_comment_cookies()
840
840
 
841
841
        /**
842
842
         * The url of the current comment author escaped for use in attributes.
843
 
         */     
 
843
         */
844
844
        $comment_author_url = esc_url($commenter['comment_author_url']);
845
845
 
846
846
        /** @todo Use API instead of SELECTs. */
970
970
        if ( !empty( $css_class ) ) {
971
971
                echo ' class="'.$css_class.'" ';
972
972
        }
973
 
        $title = esc_attr( get_the_title() );
 
973
        $title = the_title_attribute( 'echo=0' );
974
974
 
975
975
        echo apply_filters( 'comments_popup_link_attributes', '' );
976
976
 
1255
1255
                }
1256
1256
?>
1257
1257
                <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
1258
 
                <?php if ( 'ul' == $args['style'] ) : ?>
 
1258
                <?php if ( 'div' != $args['style'] ) : ?>
1259
1259
                <div id="div-comment-<?php comment_ID() ?>" class="comment-body">
1260
1260
                <?php endif; ?>
1261
1261
                <div class="comment-author vcard">
1274
1274
                <div class="reply">
1275
1275
                <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
1276
1276
                </div>
1277
 
                <?php if ( 'ul' == $args['style'] ) : ?>
 
1277
                <?php if ( 'div' != $args['style'] ) : ?>
1278
1278
                </div>
1279
1279
                <?php endif; ?>
1280
1280
<?php