Changeset 55855
- Timestamp:
- 05/25/2023 10:29:39 AM (13 days ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/deprecated.php
r55753 r55855 1589 1589 return $post; 1590 1590 } 1591 1592 /** 1593 * Queues comments for metadata lazy-loading. 1594 * 1595 * @since 4.5.0 1596 * @deprecated 6.3.0 Use wp_lazyload_comment_meta() instead. 1597 * 1598 * @param WP_Comment[] $comments Array of comment objects. 1599 */ 1600 function wp_queue_comments_for_comment_meta_lazyload( $comments ) { 1601 _deprecated_function( __FUNCTION__, '6.3.0', 'wp_lazyload_comment_meta' ); 1602 // Don't use `wp_list_pluck()` to avoid by-reference manipulation. 1603 $comment_ids = array(); 1604 if ( is_array( $comments ) ) { 1605 foreach ( $comments as $comment ) { 1606 if ( $comment instanceof WP_Comment ) { 1607 $comment_ids[] = $comment->comment_ID; 1608 } 1609 } 1610 } 1611 1612 wp_lazyload_comment_meta( $comment_ids ); 1613 } -
trunk/src/wp-includes/class-wp-query.php
r55847 r55855 4892 4892 * 4893 4893 * @since 4.4.0 4894 * @deprecated 4.5.0 See wp_ queue_comments_for_comment_meta_lazyload().4894 * @deprecated 4.5.0 See wp_lazyload_comment_meta(). 4895 4895 * 4896 4896 * @param mixed $check -
trunk/src/wp-includes/comment.php
r55753 r55855 527 527 528 528 /** 529 * Queues comments for metadata lazy-loading.530 *531 * @since 4.5.0532 * @since 6.3.0 Use wp_lazyload_comment_meta() for lazy-loading of comment meta.533 *534 * @see wp_lazyload_comment_meta()535 *536 * @param WP_Comment[] $comments Array of comment objects.537 */538 function wp_queue_comments_for_comment_meta_lazyload( $comments ) {539 // Don't use `wp_list_pluck()` to avoid by-reference manipulation.540 $comment_ids = array();541 if ( is_array( $comments ) ) {542 foreach ( $comments as $comment ) {543 if ( $comment instanceof WP_Comment ) {544 $comment_ids[] = $comment->comment_ID;545 }546 }547 }548 549 wp_lazyload_comment_meta( $comment_ids );550 }551 552 /**553 529 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 554 530 * to recall previous comments by this commentator that are still held in moderation. -
trunk/tests/phpunit/tests/query/lazyLoadCommentMeta.php
r55608 r55855 27 27 * 28 28 * @covers ::wp_queue_comments_for_comment_meta_lazyload 29 * 30 * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload 29 31 */ 30 32 public function test_wp_queue_comments_for_comment_meta_lazyload() { … … 46 48 * 47 49 * @covers ::wp_queue_comments_for_comment_meta_lazyload 50 * 51 * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload 48 52 */ 49 53 public function test_wp_queue_comments_for_comment_meta_lazyload_new_comment() {
Note: See TracChangeset
for help on using the changeset viewer.