[wp-hackers] Attempt to fix separate subpages w/ same slug name

Mike Matz mike.matz at soletechnology.com
Thu Oct 6 17:25:54 GMT 2005

> Instead of adding to the existing posts query, I have 
> update_category_cache() build $cache_category->fullpath which contains 
> the full path of the category and its parents.  Then when a category is 
> requested, it looks for the full path among the $cache_category array. 
> If it can't find it, it looks for the last directory in the path.
> These patches reduce the potential number of queries used by 1.
> Please *test*.
> Owen

Well it looks like the same thing can be done with update_page_cache() 
(note for my application, I need subpages w/ matching slugs rather than 
categories); however, update_page_cache() is only called from 
wp_list_pages(), which hasn't normally been processed at the time 
get_posts() was called.  Not sure if it makes sense to call get_pages() 
for every page load, so I'm going to stick with the extra query in 
get_posts() for now.. any thoughts on this?


More information about the wp-hackers mailing list