mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 07:35:39 +01:00
Posts, Post Types: Call update_post_author_caches
function in WP_Posts_List_Table
class.
Call the `update_post_author_caches` function in the `WP_Posts_List_Table` class to prime post author caches in a single database request. Props spacedmonkey, thakkarhardik, desrosj. Fixes #56100. Built from https://develop.svn.wordpress.org/trunk@54099 git-svn-id: http://core.svn.wordpress.org/trunk@53658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6d882a5dd9
commit
6542de4220
@ -790,6 +790,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
if ( post_type_supports( $post_type, 'comments' ) ) {
|
||||
$this->comment_pending_count = get_pending_comments_num( $post_ids );
|
||||
}
|
||||
update_post_author_caches( $posts );
|
||||
|
||||
foreach ( $posts as $post ) {
|
||||
$this->single_row( $post, $level );
|
||||
@ -885,6 +886,8 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
|
||||
$ids = array_keys( $to_display );
|
||||
_prime_post_caches( $ids );
|
||||
$_posts = array_map( 'get_post', $ids );
|
||||
update_post_author_caches( $_posts );
|
||||
|
||||
if ( ! isset( $GLOBALS['post'] ) ) {
|
||||
$GLOBALS['post'] = reset( $ids );
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.1-alpha-54098';
|
||||
$wp_version = '6.1-alpha-54099';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user