I was thinking, what kind of issues might I face if I port a plugin from WPMU to WP or vice versa.
Say I developed a plugin from scratch and wanted that plugin to be compatible with both, should I begin with WPMU or WP?
I was thinking, what kind of issues might I face if I port a plugin from WPMU to WP or vice versa.
Say I developed a plugin from scratch and wanted that plugin to be compatible with both, should I begin with WPMU or WP?
You’ll need to test in both setups, because they behave differently in a lot of situations. Some of the most notable differences are:
wpmu_new_blog
action. It has to switch to the new blog, do the activation logic, and then restore the current blog. The $id
of the new blog is passed in to the handler as the first parameter.get_site_option( 'mu_media_buttons' )
to check it and update_site_option()
to set it.You can use switch_to_blog() if you need to temporarily access another blog’s data with API functions, and then restore_current_blog() to switch back.
You can see a complete example of the activation functions by browsing the source of my plugin skeleton.