[wp-hackers] $wpdb cacheing?

Stephen Rider wp-hackers at striderweb.com
Sun Aug 19 08:59:01 GMT 2007


Hi --

I'm trying to make a function that gets a combined list of Pages from  
two different blogs (both in the same database)

Since the login info is the same, it occurred to me to try changing  
the table prefix to get the second blog's data.  Here's the code:

$mbpages1 = get_pages( $args );
$orig_prefix = $wpdb->prefix;
$wpdb->prefix = 'blah_';
$mbpages2 = get_pages( $args );
$mbpages1 = array_merge( $mbpages1, $mbpages2 );
$wpdb->prefix = $orig_prefix;

It pulls the first blog's data twice.

Is the get_pages being cached somehow?  Is there a way to reset the  
cache so it pulls the different data?

...and if I do that, is there a way for me to cache the combined list  
and thus avoid a big performance hit?

My head hurts.  Thanks in advance.

Stephen


More information about the wp-hackers mailing list