Changeset 34310 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/18/2015 07:27:39 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r34270 r34310 2378 2378 2379 2379 /** 2380 * Adds any comments from the given IDs to the cache that do not already exist in cache. 2381 * 2382 * @since 4.4.0 2383 * @access private 2384 * 2385 * @see update_comment_cache() 2386 * 2387 * @global wpdb $wpdb 2388 * 2389 * @param array $comment_ids Array of comment IDs. 2390 * @param bool $update_meta_cache Optional. Whether to update the meta cache. Default true. 2391 */ 2392 function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) { 2393 global $wpdb; 2394 2395 $non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' ); 2396 if ( !empty( $non_cached_ids ) ) { 2397 $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", join( ",", array_map( 'intval', $non_cached_ids ) ) ) ); 2398 2399 update_comment_cache( $fresh_comments, $update_meta_cache ); 2400 } 2401 } 2402 2403 /** 2380 2404 * Lazy load comment meta when inside of a `WP_Query` loop. 2381 2405 *
Note: See TracChangeset
for help on using the changeset viewer.