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

Owen Winkler ringmaster at midnightcircus.com
Thu Oct 6 18:15:30 GMT 2005


Mike Matz wrote:
> 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?

It seems I totally misread your email.  :)

But you're right, you could probably do something similar with 
update_page_cache();

I haven't looked specifically at the ramifications of this, but why not 
call update_page_cache() from get_posts() when $q['page_name'] is set? 
It might not be as direct, but it should have two benefits:

1) Compartmentalize the aggregation of page fullpaths.
2) Allow those page fullpaths to be accessed by other code after the 
cache is loaded.

Just a thought.

In any case, sorry for the misread.  The category stuff should still 
work, if anyone else is interested in reviewing it.  Maybe I'll just 
submit the patch to Trac.

Owen



More information about the wp-hackers mailing list