mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
In [53941], the addition of query caching to `WP_Query` brought about an unintended issue when querying for fields equal to id=>parent. Specifically, on websites with object caching enabled and a substantial number of pages, the second run of this query triggered the `_prime_post_caches` function for id=>parent. This led to the unnecessary priming of post, meta, and term caches, even when only id and parent information were requested. This commit addresses this issue by introducing a new function, `_prime_post_parents_caches`, which primes a dedicated cache for post parents. This cache is primed during the initial query execution. Subsequently, the `wp_cache_get_multiple` function is employed to retrieve all post parent data in a single object cache request, optimizing performance. Additionally, this commit extends the coverage of existing unit tests to ensure the reliability of the changes. Props kevinfodness, joemcgill, peterwilsoncc, LinSoftware, thekt12, spacedmonkey. Fixes #59188 git-svn-id: https://develop.svn.wordpress.org/trunk@56763 602fd350-edb4-49c9-b593-d223f7449a82 |
||
|---|---|---|
| .. | ||
| e2e | ||
| gutenberg | ||
| performance | ||
| phpunit | ||
| qunit | ||
| visual-regression | ||