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

Coming Soon!

Adding your Extension

Description
The “mainwp_getextensions” filter is used to add your extension to MainWP.

Usage

Where ‘plugin_get_extension’ is the function MainWP should call when the $extensions array is being retrieved. Note that the filter function must return an array of extensions after it is finished processing, or no extensions will be displayed, and other plugins also filtering the $extensions array may generate errors.

plugin_get_extension should be unique function name. It cannot match any other function name already declared.

Examples
Both examples use the following two actions to add the settings page header and footer: mainwp-pageheader-extensions and mainwp-pagefooter-extensions

Add an extension without authentication
The following example adds your extension to MainWP.

Add an extension with authentication
The following example adds your extension to MainWP.

Please not to add the authentication you need to implement an mechanism to fill up the $locked variable in the example above.