[wp-hackers] Cloning content from Master site into new sites on a WP Network

Mike Little wordpress at zed1.com
Wed Jul 11 20:51:15 UTC 2012


On 11 July 2012 21:24, Jesse Friedman <highfive at jesserfriedman.com> wrote:

> One last question can you add custom post types to a new post in this
> fashion IF those custom post types are defined by a plugin?
>
> Since it's a new site and the switch_to_blog() function ignores plugins
> will it return an error?
>
>
You would have to ensure the required plugin was already active on the new
site. Network enabled or mu-plugins should ensure that.

One other thing to be aware of is that some actions you may call when
switched to another blog might increase the memory requirements hugely.

I recently had a problem where switching to another site and calling a
standard WordPress function get_option(). Unfortunately, WordPress
pre-loads almost all options when you first call it. This additional memory
allocation was too much for my set up. I needed to make a database call in
the end to grab that one option.

Mike
-- 
Mike Little
http://zed1.com/


More information about the wp-hackers mailing list