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 must be logged in to post a comment.
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 andupdate_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.
There is no difference.
From http://mu.wordpress.org/
While developing use a multi-site installation, because sometimes file handling and paths are a little bit tricky.
If you’ve never built a plugin before, and you’re planning on releasing one to the WordPress repository, then you’re going to have a hard enough time fixing all of your WP bugs to even worry about WPMU compatibility.
Go with WP first and learn it inside and out. Then you can start learning about what makes a WPMU plugin different from a WP one.
A WP plugin is a plugin that is incompatible with WP Multi-sites. There’s actually a lot of things that you need to understand about plugins to even begin to understand the WPMU dev requirements that you’ll face.