Run Code For Multisite On Plugin Activation

Plugin Development

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 . . .

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To Newsletter

Get weekly updates to your email