[wp-hackers] switch to blog multisite

Dobri dyordan1 at ramapo.edu
Fri Dec 6 15:04:41 UTC 2013


I think I figured out a way to do what I wanted, it was a little bit different from what you offered. I've attached the code just in case anyone else on the list ever needs to do this. Also, I'm open to feedback, it seems to be working so far but I can already anticipate an issue when switching from say wp_3 to prefix_3 because it will think it's the same blog and switch_to_blog will bail early. I'm working on that.

http://pastebin.com/w85enEhJ

~Dobri

On Thu, 5 Dec 2013, at 2:55 PM, Amy Hendrix wrote:

> I'm not sure exactly what you have in mind, but WP Multi Network
> (http://wordpress.org/plugins/wp-multi-network/) should get you at
> least part of the way there.
> 
> On Thu, Dec 5, 2013 at 2:52 PM, Dobri <dyordan1 at ramapo.edu> wrote:
>> Hi everyone,
>> 
>> Here's a crazy idea:
>> 
>> I have two multisite installs linked to the same database using shared wp_users and wp_usermeta tables and different prefixes. Sometimes, I need data from one network to be pulled into the other one. Is there any way to pull this off with switch_to_blog-ish approach? My idea - be able to switch to a blog on the other network, do things in a natural way using any wp functions and hooks I'm used to and then revert back to the original blog on the first network. Is something like that doable or should I just stick to raw MySQL queries at that point? Thanks!
>> 
>> Both networks have identical db connection (username/pass/domain/db/etc.) and configurations, only difference is the table prefix.
>> 
>> ~Dobri
>> 
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list