Make WordPress Core

Changeset 55856


Ignore:
Timestamp:
05/25/2023 10:53:52 AM (22 months ago)
Author:
spacedmonkey
Message:

Comments: Move wp_queue_comments_for_comment_meta_lazyload function to the correct file.

As of [55855] wp_queue_comments_for_comment_meta_lazyload was deprecated. But deprecate to wp-admin/deprecated.php and not wp-includes/deprecated.php.This is incorrect, as this is a public function and not an admin function.

Props SergeyBiryukov, spacedmonkey.
See #58301.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/deprecated.php

    r55855 r55856  
    15891589    return $post;
    15901590}
    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/deprecated.php

    r55753 r55856  
    46404640    _deprecated_function( __FUNCTION__, '6.3.0' );
    46414641}
     4642
     4643/**
     4644 * Queues comments for metadata lazy-loading.
     4645 *
     4646 * @since 4.5.0
     4647 * @deprecated 6.3.0 Use wp_lazyload_comment_meta() instead.
     4648 *
     4649 * @param WP_Comment[] $comments Array of comment objects.
     4650 */
     4651function wp_queue_comments_for_comment_meta_lazyload( $comments ) {
     4652    _deprecated_function( __FUNCTION__, '6.3.0', 'wp_lazyload_comment_meta' );
     4653    // Don't use `wp_list_pluck()` to avoid by-reference manipulation.
     4654    $comment_ids = array();
     4655    if ( is_array( $comments ) ) {
     4656        foreach ( $comments as $comment ) {
     4657            if ( $comment instanceof WP_Comment ) {
     4658                $comment_ids[] = $comment->comment_ID;
     4659            }
     4660        }
     4661    }
     4662
     4663    wp_lazyload_comment_meta( $comment_ids );
     4664}
Note: See TracChangeset for help on using the changeset viewer.