Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#56978 closed enhancement (fixed)

Use `update_post_author_caches ` in `wp_prepare_revisions_for_js`

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

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

Download all attachments as: .zip

Change History (8)

@benjgrolleau
4 years ago

First patch.

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

#3 @benjgrolleau
4 years ago

Here is the correct patch @spacedmonkey. :-)

Last edited 4 years ago by benjgrolleau (previous) (diff)

#4 @spacedmonkey
4 years ago

  • Keywords commit added

Changes looks good to me. Adding commit keyword.

#5 @spacedmonkey
4 years ago

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

#6 @spacedmonkey
4 years ago

  • Resolution → fixed
  • Status assigned → 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.