Run Code For Multisite On Plugin Activation

Paulund is full of premium tutorials and support to help with your development

Sign up to get full access to all tutorials.

Get full access for $5/mo

Login to your account


When you're developing a new plugin you may need to run some code on the activation of the plugin. For example if your plugin requires a database table to be installed on the site then you need to make sure that this database table is created on plugin activation. To activate a hook to run when the plugin is activated you can use a WordPress function called register_activation_hook. The problem with this is that if you're running a multisite WordPress install you might need the code to . . . This content is restricted to subscribers