WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/10/2012 04:09:44 PM (9 years ago)
Author:
ryan
Message:

Pass post_type to clean_post_cache() instead of attempting to fetch a post object since the post may have been deleted.

Props leewillis77
see #19690

File:
1 edited

Legend:

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

    r20378 r20423  
    15841584    $wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) );
    15851585
    1586     if ( 'page' == $post->post_type )
    1587         clean_page_cache( $post_id );
    1588     else
    1589         clean_post_cache( $post_id );
     1586    clean_post_cache( $post_id, $post->post_type );
    15901587
    15911588    do_action('wp_update_comment_count', $post_id, $new, $old);
Note: See TracChangeset for help on using the changeset viewer.