[wp-hackers] Cloning content from Master site into new sites on a WP Network
Jesse Friedman
highfive at jesserfriedman.com
Wed Jul 11 20:24:10 UTC 2012
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?
Jesse
On Wed, Jul 11, 2012 at 3:34 PM, Otto <otto at ottodestruct.com> wrote:
> On Wed, Jul 11, 2012 at 2:14 PM, Bill Dennen <dennen at gmail.com> wrote:
> > One thing that has puzzled me is the notion that switch_to_blog
> > shouldn't be used too often. How often is too often? Is it even
> > possible to measure such a thing?
> >
> > Put it another way - when is it safe to use, and when is it not? At
> > what point does it affect performance?
> >
> > Of course, every site is different. So there probably isn't a hard and
> > fast rule.
> >
> > But, switch_to_blog is a very useful tool. I use it for many things --
> > and when combined with things like transients and other caching, I
> > don't notice any performance problems.
>
> It becomes a problem when it becomes a problem, basically. :) There's
> no hard and fast rule.
>
> The thing is that it's tempting to use it stupidly, in loops and such.
> Like, if you wanted to get the latest 10 posts across a multisite
> setup, then one might try to loop through all the sites, get the
> latest posts from them, then order them up yourself. This might work
> fine if you have 4 sites, but when you have 40, or 400, or 4000, then
> the same code breaks miserably.
>
> So use it sparingly, basically. Probably not something you want to be
> doing on every page load.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
thanks,
*Jesse Friedman*
508-507-9673 | jesserfriedman at gmail.com
http://jesserfriedman.com | @professor <http://twitter.com/professor>
More information about the wp-hackers
mailing list