﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
20177	Unneccessary term cache query for pages	TheDeadMedic	nacin	"When a request for a page is queried, {{{$post_type}}} in {{{WP_Query::get_posts()}}} is an empty string, which is then passed to {{{update_post_caches()}}}.

This in turn calls {{{update_object_term_cache()}}} for 'post' (the default if {{{$post_type}}} is empty) instead of 'page'.

Since pages don't have taxonomies (at least not in a default setup), we're simply wasting a query. But even if they ''did'' have, we wouldn't even be caching the right ones (unless of course pages were assigned the same taxes as posts).

I would say there's two options here; review {{{WP_Query::get_posts()}}} to ensure the local variable {{{$post_type}}} is set correctly, or simply pass the string {{{'any'}}} to {{{update_post_caches()}}} (which will then correctly determine the post type(s)) - thoughts?



"	defect (bug)	closed	normal	3.5	Query	1.5	normal	fixed	has-patch	
