[wp-trac] [WordPress Trac] #45366: Optimize wp_get_post_revisions() call in wp_list_post_revisions()

WordPress Trac noreply at wordpress.org
Fri Nov 16 23:43:09 UTC 2018


#45366: Optimize wp_get_post_revisions() call in wp_list_post_revisions()
---------------------------+------------------------------
 Reporter:  greatislander  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Revisions      |     Version:  4.9.8
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  performance
---------------------------+------------------------------

Comment (by birgire):

 Replying to [comment:1 greatislander]:
 > Digging deeper, it looks like `wp_post_revision_title_expanded()` will
 fetch full post objects if passed an ID, even though it only needs
 `post_type`, `post_author` and `post_modified`. So this can probably be
 optimized as well. I'll open as a second issue.

 If I understand correctly you see performance gain with
 [attachment:"45366.diff"] even though
 {{{wp_post_revision_title_expanded()}}} is fetching full post objects?

 Somewhat related is #44321 with similar improvements made within the REST
 API for the revision count:

 https://core.trac.wordpress.org/ticket/44321#comment:5

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45366#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list