Thord Daniel Hedengren - Smashing WordPress_ Beyond the Blog-Wiley (2014)

(avery) #1

178 PART III • Using Plugins with WordPress


DEVELOPING PLUGINS FOR NETWORKS


As of WordPress 3.0, the multiuser version of WordPress, previously called WordPress MU, is
a part of the regular version. Now called WordPress multisite, this feature is used to power
multiple blogs at once, in a network. Most plugins (and themes for that matter) will work with
the multisite feature. The only time you may run into issues is if you add tables to the database
or possibly if you play with the core tables. You can activate this feature by adding a few lines
of code to your wp-config.php file. To get you started, add the following line above the “That
is all, stop editing!” line in the wp-config.php file of your install:

define( 'WP_ALLOW_MULTISITE', true );

This will enable the Network Admin link in your WordPress admin interface (see Figure 7-2).
WordPress will then guide you through the simple steps needed to get your multisite feature
up and running. You can read more about that in the Codex at http://codex.
wordpress.org/Create_A_Network.

Figure 7-2: The Network Admin looks something like this.

A multisite can most easily be described as something of an umbrella that allows admin
superusers to manage other blogs created underneath. On WordPress.com, anyone can create
a blog, but that isn’t necessarily the way a WordPress multisite install works; you can just as
well run it to power multiple blogs (such as a blog network) and not let users register and/or
create their own blogs.

The process of developing plugins for WordPress using a multisite doesn’t differ much from
that of traditional WordPress plugins. The only differences are in the database and to a minor
degree, in the directory structure.
Free download pdf