[wp-hackers] Shared MultiSite Menus

Jesse Friedman me at jes.se.com
Thu May 30 15:16:04 UTC 2013


I have a rather unique situation. I have a multisite installation with
approx 600 sites.

Of these 600 sites, #500, #501, #502, and #503 need to share menu's with
each other.

Currently the best solution I have found is to use switch_to_blog() to pull
in the necessary nav menus, on each site. This works just fine, although I
can't really predict the load this might put on the network, as I know that
switch_to_blog() is not really the most efficient function.

So if you're on site #501 I'd use switch_to_blog 3 times to get the menus
from #500, #502, and #503.

All 4 sites use the same exact theme.

Option 2
I have also considered saving the menus as Site options in site #500. So
each time a menu is saved in #503, it will also save the raw HTML as a site
option in #500.  This way, I only need to switch_to_blog() once, if I'm not
on site number #500.

Option 3
I have also considered saving the nav menus HTML as site options for all
sites, this way there will never be a switch_to_blog() function on site load

Of course, I will use transients to only run the switch_to_blog() once a
day.

Does anyone have any better ideas? I don't necessarily need code, but a
better plan of attack.

-- 
thanks

*jesse friedman*
jes.se.com *
*
Book: Web Designers Guide to WordPress -
http://wdgwp.com/onamazon<http://wdgwp.com/onamazon>
Twitter: @professor <http://twitter.com/professor>
Facebook: Like<https://www.facebook.com/pages/Jesse-Friedman/204793299545174>


More information about the wp-hackers mailing list