Opened 16 years ago
Closed 16 years ago
#14821 closed enhancement (duplicate)
Add multiple post type support to update_object_term_cache()
| Reported by: | johnbillion | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Performance | Version: | 3.0.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
update_object_term_cache() only accepts one post_type. If a loop contains more than one post type then the object term cache isn't populated and your queries can go through the roof.
See http://lists.automattic.com/pipermail/wp-hackers/2010-September/034776.html
Patch coming up.
Attachments (2)
Change History (7)
#2
@
16 years ago
We should probably adjust update_object_term_cache() to accept multiple post types instead, that way we still keep to a single wp_get_object_terms() call.
Support for it should probably be pretty easy. Simply call get_object_taxonomies() for each post type and merge the result, I think.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch.
This patch changes
update_post_caches()so it callsupdate_object_term_cache()for each post type in the $posts array if the $post_type parameter isn't set or it's set to 'any'.