Make WordPress Core

Opened 2 years ago

Last modified 15 months ago

#56105 new enhancement

Call update_post_parent_caches in the_post function in WP_Query class

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


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
2 years ago

  • Component changed from General to Query

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

2 years ago

#3 @ironprogrammer
2 years ago

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

Thanks for your report @priyankkpatel!

Related: #55593, #56036, #56037

#4 @spacedmonkey
15 months 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.