Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#56105 new enhancement

Call update_post_parent_caches in the_post function in WP_Query class

Reported by: priyankkpatel Owned by:
Priority: normal Milestone: Awaiting Review
Component: Query Version:
Severity: normal Keywords: needs-patch needs-unit-tests
Cc: Focuses: performance

Description

Hello Team,

In the_post function class WP_Query, update_post_author_caches is already in use but not update_post_parent_caches.

I am not sure if it is because of update_post_parent_caches calls the private function _prime_post_caches or what.

Change History (4)

#1 @priyankkpatel
4 years ago

  • Component General → Query

This ticket was mentioned in ​Slack in #core-test by ironprogrammer. ​View the logs.


4 years ago

#3 @ironprogrammer
4 years ago

  • Focuses performance added
  • Keywords needs-patch needs-unit-tests added
  • Type defect (bug) → enhancement

Thanks for your report @priyankkpatel!

Related: #55593, #56036, #56037

#4 @spacedmonkey
3 years ago

@priyankkpatel Can you provide anymore context here? Why is it needed to prime the caches on post parents in the loop. A standard loop does not call the parent. There is nothing stopping you from call update_post_parent_caches within your own code, if you have an issue in your own theme/plugin.

Note: See TracTickets for help on using tickets.