Definition:
function get_comment_count( $post_id = 0 ) {}
Parameters
- int $post_id: Optional. Comment amount in post if > 0, else total comments blog wide.
Return values
returns:The amount of spam, approved, awaiting moderation, and total comments.
Source code
function get_comment_count( $post_id = 0 ) {
global $wpdb;
$post_id = (int) $post_id;
$where = '';
if ( $post_id > 0 ) {
$where = $wpdb->prepare("WHERE comment_post_ID = %d", $post_id);
}
$totals = (array) $wpdb->get_results("
SELECT comment_approved, COUNT( * ) AS total
FROM {$wpdb->comments}
1308

February 12, 2011 


get_comment_date
Definition:
function get_comment_date( $d = '', $comment_ID = 0 ) {}
Parameters
Return values
returns:The comment’s date
Defined filters
apply_filters('get_comment_date', $date, $d)Source code
function get_comment_date( $d = '', $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); if ( '' == $d ) $date = mysql2date(get_option('date_format'), $comment->comment_date); else $date = mysql2date($d, $comment->comment_date); return apply_filters('get_comment_date', $date, $d); }1310