Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#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 2 years ago.
First patch.
56978-2.diff (544 bytes) - added by benjgrolleau 2 years ago.

Download all attachments as: .zip

Change History (8)

@benjgrolleau
2 years ago

First patch.

#1 @benjgrolleau
2 years 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
2 years ago

@benjgrolleau Thanks for your patch.

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

@benjgrolleau
2 years ago

#3 @benjgrolleau
2 years ago

Here is the correct patch. :-)

Version 0, edited 2 years ago by benjgrolleau (next)

#4 @spacedmonkey
2 years ago

  • Keywords commit added

Changes looks good to me. Adding commit keyword.

#5 @spacedmonkey
2 years ago

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

#6 @spacedmonkey
2 years 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.