Changeset 22080
- Timestamp:
- 09/28/2012 12:47:31 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/comment.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r22079 r22080 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_set( 'last_changed', 1, 'comment' ); 257 255 $cache_key = "get_comments:$key:$last_changed"; 258 256 259 if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {257 if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) 260 258 return $cache; 261 }262 259 263 260 $post_id = absint($post_id); … … 1294 1291 do_action('wp_insert_comment', $id, $comment); 1295 1292 1293 wp_cache_incr( 'last_changed', 1, 'comment' ); 1294 1296 1295 return $id; 1297 1296 } … … 1965 1964 wp_cache_delete($id, 'comment'); 1966 1965 1967 wp_cache_ set('last_changed', time(), 'comment');1966 wp_cache_incr( 'last_changed', 1, 'comment' ); 1968 1967 } 1969 1968
Note: See TracChangeset
for help on using the changeset viewer.