Opened 15 years ago
Closed 15 years ago
#14821 closed enhancement (duplicate)
Add multiple post type support to update_object_term_cache()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.1 |
Component: | Performance | Keywords: | has-patch |
Focuses: | Cc: |
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
@
15 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.
Note: See
TracTickets for help on using
tickets.
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'.