Ticket #22024: 22024.2.diff
File 22024.2.diff, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/comment.php
249 249 250 250 // $args can be whatever, only use the args defined in defaults to compute the key 251 251 $key = md5( serialize( compact(array_keys($defaults)) ) ); 252 $last_changed = wp_cache_get('last_changed', 'comment'); 253 if ( ! $last_changed ) { 254 $last_changed = time(); 255 wp_cache_set('last_changed', $last_changed, 'comment'); 256 } 252 $last_changed = wp_cache_get( 'last_changed', 'comment' ); 253 if ( ! $last_changed ) 254 $last_changed = wp_cache_incr( 'last_changed', 1, 'comment' ); 257 255 $cache_key = "get_comments:$key:$last_changed"; 258 256 259 257 if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) { … … 1293 1291 $comment = get_comment($id); 1294 1292 do_action('wp_insert_comment', $id, $comment); 1295 1293 1294 wp_cache_incr('last_changed', 1, 'comment'); 1295 1296 1296 return $id; 1297 1297 } 1298 1298 … … 1964 1964 foreach ( (array) $ids as $id ) 1965 1965 wp_cache_delete($id, 'comment'); 1966 1966 1967 wp_cache_ set('last_changed', time(), 'comment');1967 wp_cache_incr('last_changed', 1, 'comment'); 1968 1968 } 1969 1969 1970 1970 /**