Changeset 34711 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/30/2015 01:34:54 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r34661 r34711 2453 2453 } 2454 2454 2455 /**2456 * Lazy load comment meta when inside of a `WP_Query` loop.2457 *2458 * @since 4.4.02459 *2460 * @param null $check The `$check` param passed from the 'pre_comment_metadata' hook.2461 * @param int $comment_id ID of the comment whose metadata is being cached.2462 * @return null In order not to short-circuit `get_metadata()`.2463 */2464 function wp_lazyload_comment_meta( $check, $comment_id ) {2465 global $wp_query;2466 2467 if ( ! empty( $wp_query->comments ) ) {2468 // Don't use `wp_list_pluck()` to avoid by-reference manipulation.2469 $comment_ids = array();2470 foreach ( $wp_query->comments as $comment ) {2471 $comment_ids[] = $comment->comment_ID;2472 }2473 update_meta_cache( 'comment', $comment_ids );2474 }2475 2476 return $check;2477 }2478 2479 2455 // 2480 2456 // Internal
Note: See TracChangeset
for help on using the changeset viewer.