Make WordPress Core


Ignore:
Timestamp:
02/05/2008 06:47:27 AM (17 years ago)
Author:
ryan
Message:

Trailing whitespace cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r6668 r6726  
    245245    }
    246246
    247     $totals = (array) $wpdb->get_results(" 
    248         SELECT comment_approved, COUNT( * ) AS total 
    249         FROM {$wpdb->comments} 
    250         {$where} 
    251         GROUP BY comment_approved 
     247    $totals = (array) $wpdb->get_results("
     248        SELECT comment_approved, COUNT( * ) AS total
     249        FROM {$wpdb->comments}
     250        {$where}
     251        GROUP BY comment_approved
    252252    ", ARRAY_A);
    253253
    254     $comment_count = array(                         
    255         "approved"              => 0,               
     254    $comment_count = array(
     255        "approved"              => 0,
    256256        "awaiting_moderation"   => 0,
    257257        "spam"                  => 0,
    258258        "total_comments"        => 0
    259     ); 
    260 
    261     foreach ( $totals as $row ) { 
    262         switch ( $row['comment_approved'] ) { 
    263             case 'spam': 
    264                 $comment_count['spam'] = $row['total']; 
     259    );
     260
     261    foreach ( $totals as $row ) {
     262        switch ( $row['comment_approved'] ) {
     263            case 'spam':
     264                $comment_count['spam'] = $row['total'];
    265265                $comment_count["total_comments"] += $row['total'];
    266                 break; 
    267             case 1: 
    268                 $comment_count['approved'] = $row['total']; 
     266                break;
     267            case 1:
     268                $comment_count['approved'] = $row['total'];
    269269                $comment_count['total_comments'] += $row['total'];
    270                 break; 
     270                break;
    271271            case 0:
    272272                $comment_count['awaiting_moderation'] = $row['total'];
     
    789789function wp_defer_comment_counting($defer=null) {
    790790    static $_defer = false;
    791    
     791
    792792    if ( is_bool($defer) ) {
    793793        $_defer = $defer;
     
    796796            wp_update_comment_count( null, true );
    797797    }
    798    
     798
    799799    return $_defer;
    800800}
     
    820820function wp_update_comment_count($post_id, $do_deferred=false) {
    821821    static $_deferred = array();
    822    
     822
    823823    if ( $do_deferred ) {
    824824        $_deferred = array_unique($_deferred);
     
    828828        }
    829829    }
    830    
     830
    831831    if ( wp_defer_comment_counting() ) {
    832832        $_deferred[] = $post_id;
     
    836836        return wp_update_comment_count_now($post_id);
    837837    }
    838        
     838
    839839}
    840840
     
    848848 *
    849849 * @param int $post_id Post ID
    850  * @return bool False on '0' $post_id or if post with ID does not exist. True on success. 
     850 * @return bool False on '0' $post_id or if post with ID does not exist. True on success.
    851851 */
    852852function wp_update_comment_count_now($post_id) {
Note: See TracChangeset for help on using the changeset viewer.