Tutorials

MainWP Codex is a great place to learn how to extend the MainWP plugin creating custom extensions or simple customizations.

Actions & Filters

See all available hooks in the MainWP plugin that will allow you to add data or change how MainWP works.

Code Reference

Browse MainWP codebase to learn what’s going on inside the MainWP plugin core files.

REST API

The MainWP API uses REST conventions and returns all data in JSON format. Requests may be made using the HTTPS protocol and must be authenticated using a Consumer Key and Consumer Secret. The API supports 3 primary resources, each with a related set of endpoints: Response bodies from the MainWP API are in JSON format, with a Content-Type: of application/json and UTF-8 character encoding.

Check if MainWP is Enabled

To check if the plugin is enabled we work with a two-step mechanism.

First, you have the filter ‘mainwp_activated_check’. This filter will return true if the main plugin is activated. Because sometimes our main plugin is activated after the extension plugin is activated we also have a second step, listening to the ‘mainwp-activated’ action. This action is triggered by MainWP after initialization.

In the example above you can see that the child-plugin calls the function “activate_this_plugin”, this function will include the initialization of your own plugin.