Changeset 55749 for trunk/src/wp-includes/comment.php
- Timestamp:
- 05/11/2023 12:25:51 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r55732 r55749 486 486 487 487 /** 488 * Queue comment meta for lazy-loading. 489 * 490 * @since 6.3.0 491 * 492 * @param array $comment_ids List of comment IDs. 493 */ 494 function wp_lazyload_comment_meta( array $comment_ids ) { 495 if ( empty( $comment_ids ) ) { 496 return; 497 } 498 $lazyloader = wp_metadata_lazyloader(); 499 $lazyloader->queue_objects( 'comment', $comment_ids ); 500 } 501 502 /** 488 503 * Updates comment meta field based on comment ID. 489 504 * … … 515 530 * 516 531 * @since 4.5.0 532 * @since 6.3.0 Use wp_lazyload_comment_meta() for lazy-loading of comment meta. 533 * 534 * @see wp_lazyload_comment_meta() 517 535 * 518 536 * @param WP_Comment[] $comments Array of comment objects. … … 529 547 } 530 548 531 if ( $comment_ids ) { 532 $lazyloader = wp_metadata_lazyloader(); 533 $lazyloader->queue_objects( 'comment', $comment_ids ); 534 } 549 wp_lazyload_comment_meta( $comment_ids ); 535 550 } 536 551 … … 3332 3347 * @since 4.4.0 3333 3348 * @since 6.1.0 This function is no longer marked as "private". 3349 * @since 6.3.0 Use wp_lazyload_comment_meta() for lazy-loading of comment meta. 3334 3350 * 3335 3351 * @see update_comment_cache() … … 3346 3362 $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); 3347 3363 3348 update_comment_cache( $fresh_comments, $update_meta_cache ); 3364 update_comment_cache( $fresh_comments, false ); 3365 } 3366 3367 if ( $update_meta_cache ) { 3368 wp_lazyload_comment_meta( $comment_ids ); 3349 3369 } 3350 3370 }
Note: See TracChangeset
for help on using the changeset viewer.