Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
WP-r55856: Comments: Move wp_queue_comments_for_comment_meta_lazyload…
Browse files Browse the repository at this point in the history
… function to the correct file.

As of https://core.trac.wordpress.org/changeset/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.

WP:Props SergeyBiryukov, spacedmonkey.
See https://core.trac.wordpress.org/ticket/58301.

Conflicts:
- src/wp-includes/deprecated.php

---

Merges https://core.trac.wordpress.org/changeset/55856 / WordPress/wordpress-develop@69718b2612 to ClassicPress.
  • Loading branch information
spacedmonkey authored and mattyrob committed Nov 3, 2023
1 parent 7049482 commit 223bc57
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/wp-admin/includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -1588,26 +1588,3 @@ function image_attachment_fields_to_save( $post, $attachment ) {

return $post;
}

/**
* Queues comments for metadata lazy-loading.
*
* @since 4.5.0
* @deprecated 6.3.0 Use wp_lazyload_comment_meta() instead.
*
* @param WP_Comment[] $comments Array of comment objects.
*/
function wp_queue_comments_for_comment_meta_lazyload( $comments ) {
_deprecated_function( __FUNCTION__, '6.3.0', 'wp_lazyload_comment_meta' );
// Don't use `wp_list_pluck()` to avoid by-reference manipulation.
$comment_ids = array();
if ( is_array( $comments ) ) {
foreach ( $comments as $comment ) {
if ( $comment instanceof WP_Comment ) {
$comment_ids[] = $comment->comment_ID;
}
}
}

wp_lazyload_comment_meta( $comment_ids );
}
74 changes: 74 additions & 0 deletions src/wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4441,3 +4441,77 @@ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' )

return null;
}
<<<<<<< HEAD
=======

/**
* Returns the correct template for the site's home page.
*
* @access private
* @since 6.0.0
* @deprecated 6.2.0 Site Editor's server-side redirect for missing postType and postId
* query args is removed. Thus, this function is no longer used.
*
* @return array|null A template object, or null if none could be found.
*/
function _resolve_home_block_template() {
_deprecated_function( __FUNCTION__, '6.2.0' );

$show_on_front = get_option( 'show_on_front' );
$front_page_id = get_option( 'page_on_front' );

if ( 'page' === $show_on_front && $front_page_id ) {
return array(
'postType' => 'page',
'postId' => $front_page_id,
);
}

$hierarchy = array( 'front-page', 'home', 'index' );
$template = resolve_block_template( 'home', $hierarchy, '' );

if ( ! $template ) {
return null;
}

return array(
'postType' => 'wp_template',
'postId' => $template->id,
);
}

/**
* Displays the link to the Windows Live Writer manifest file.
*
* @link https://msdn.microsoft.com/en-us/library/bb463265.aspx
* @since 2.3.1
* @deprecated 6.3.0 WLW manifest is no longer in use and no longer included in core,
* so the output from this function is removed.
*/
function wlwmanifest_link() {
_deprecated_function( __FUNCTION__, '6.3.0' );
}

/**
* Queues comments for metadata lazy-loading.
*
* @since 4.5.0
* @deprecated 6.3.0 Use wp_lazyload_comment_meta() instead.
*
* @param WP_Comment[] $comments Array of comment objects.
*/
function wp_queue_comments_for_comment_meta_lazyload( $comments ) {
_deprecated_function( __FUNCTION__, '6.3.0', 'wp_lazyload_comment_meta' );
// Don't use `wp_list_pluck()` to avoid by-reference manipulation.
$comment_ids = array();
if ( is_array( $comments ) ) {
foreach ( $comments as $comment ) {
if ( $comment instanceof WP_Comment ) {
$comment_ids[] = $comment->comment_ID;
}
}
}

wp_lazyload_comment_meta( $comment_ids );
}
>>>>>>> 69718b2612 (Comments: Move wp_queue_comments_for_comment_meta_lazyload function to the correct file. )

0 comments on commit 223bc57

Please sign in to comment.