Changeset 34268 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/17/2015 07:29:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r34253 r34268 2358 2358 * 2359 2359 * @since 2.3.0 2360 * 2361 * @param array $comments Array of comment row objects 2362 */ 2363 function update_comment_cache($comments) { 2360 * @since 4.4.0 Introduced the `$update_meta_cache` parameter. 2361 * 2362 * @param array $comments Array of comment row objects 2363 * @param bool $update_meta_cache Whether to update commentmeta cache. Default true. 2364 */ 2365 function update_comment_cache( $comments, $update_meta_cache = true ) { 2364 2366 foreach ( (array) $comments as $comment ) 2365 2367 wp_cache_add($comment->comment_ID, $comment, 'comment'); 2368 2369 if ( $update_meta_cache ) { 2370 // Avoid `wp_list_pluck()` in case `$comments` is passed by reference. 2371 $comment_ids = array(); 2372 foreach ( $comments as $comment ) { 2373 $comment_ids[] = $comment->comment_ID; 2374 } 2375 update_meta_cache( 'comment', $comment_ids ); 2376 } 2366 2377 } 2367 2378
Note: See TracChangeset
for help on using the changeset viewer.