Make WordPress Core

Changeset 37614


Ignore:
Timestamp:
06/01/2016 09:55:19 PM (10 years ago)
Author:
boonebgorges
Message:

Use clean_comment_cache() in wp_insert_comment().

Previously, only the 'last_changed' incrementor was manually invalidated, since
the newly created comment did not yet exist in the cache. However, this created
an inconsistency with the other comment CRUD functions, which result in the
'clean_comment_cache' action firing.

Props spacedmonkey.
See #36906.

File:
1 edited

Legend:

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

    r37542 r37614  
    15891589                wp_update_comment_count( $comment_post_ID );
    15901590        }
     1591
     1592        clean_comment_cache( $id );
     1593
    15911594        $comment = get_comment( $id );
    15921595
    … …  
    16071610         */
    16081611        do_action( 'wp_insert_comment', $id, $comment );
    1609 
    1610         wp_cache_set( 'last_changed', microtime(), 'comment' );
    16111612
    16121613        return $id;
Note: See TracChangeset for help on using the changeset viewer.