Make WordPress Core

#56978 closed enhancement (fixed)

Use `update_post_author_caches ` in `wp_prepare_revisions_for_js`

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.2 Priority: normal
Severity: normal Version: 6.1
Component: Revisions Keywords: good-first-bug has-patch commit
Focuses: performance Cc:

Description

Replace call to cache_users in wp_prepare_revisions_for_js function with update_post_author_caches.

Attachments (2)

56978.diff (542 bytes) - added by benjgrolleau 18 months ago.
First patch.
56978-2.diff (544 bytes) - added by benjgrolleau 18 months ago.

Download all attachments as: .zip

Change History (8)

@benjgrolleau
18 months ago

First patch.

#1 @benjgrolleau
18 months ago

  • Keywords has-patch added

Hello,

I've just made the patch.
I've replaced cache_users with update_post_author_caches and pass as argument the $post instead of the auhors plucked list.

Maybe I have to change $post by $revisions ?

Have a great day !

#2 @spacedmonkey
18 months ago

@benjgrolleau Thanks for your patch.

How it is incorrect. This function accepts an array of post objects. Also $revisions should be passed.

#3 @benjgrolleau
18 months ago

Here is the correct patch @spacedmonkey. :-)

Last edited 18 months ago by benjgrolleau (previous) (diff)

#4 @spacedmonkey
17 months ago

  • Keywords commit added

Changes looks good to me. Adding commit keyword.

#5 @spacedmonkey
17 months ago

  • Milestone changed from Awaiting Review to 6.2
  • Owner set to spacedmonkey
  • Status changed from new to assigned

#6 @spacedmonkey
17 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 54939:

Revisions: Use update_post_author_caches in wp_prepare_revisions_for_js function.

The update_post_author_caches function was added in [53482]. Replace call to cache_users function with update_post_author_caches, for consistency and code quality.

Props benjgrolleau, spacedmonkey.
Fixes #56978.

Note: See TracTickets for help on using tickets.