WordPress.org

Make WordPress Core

Ticket #15566: 15566.patch

File 15566.patch, 755 bytes (added by hakre, 3 years ago)
  • wp-includes/comment.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    15641564        $new = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id) ); 
    15651565        $wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) ); 
    15661566 
    1567         if ( 'page' == $post->post_type ) 
    1568                 clean_page_cache( $post_id ); 
    1569         else 
    1570                 clean_post_cache( $post_id ); 
     1567        clean_page_cache( $post_id ); 
    15711568 
    15721569        do_action('wp_update_comment_count', $post_id, $new, $old); 
    15731570        do_action('edit_post', $post_id, $post);