Download the PHP package biont/wordpress-subplugins without Composer
On this page you can find all versions of the php package biont/wordpress-subplugins. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download biont/wordpress-subplugins
More information about biont/wordpress-subplugins
Files in biont/wordpress-subplugins
Package wordpress-subplugins
Short Description A library that allows you to add arbitrary new plugin pages to WordPress
License MIT
Homepage https://github.com/Biont/WordPress-SubPlugins
Informations about the package wordpress-subplugins
WordPress-SubPlugins
A library that allows you to add arbitrary new plugin pages to WordPress. You can use it to make your plugins more modular and allow users to turn features on and off as they wish
Example implementation
This assumes the following folder structure:
wp-content/plugins/my-plugin/my-plugin.php - WordPress Plugin file
wp-content/plugins/my-plugin/lib/sub-plugins - SubPlugin library
wp-content/plugins/my-plugin/plugins - Subplugin folder
wp-content/plugins/my-plugin/my-plugin.php
wp-content/plugins/my-plugin/plugins/hello-world/hello-world.php
Sub-Plugins work just like regular WordPress plugins, with one exception: I have made the deliberate change to include the (strtoupper'd) plugin prefix in the "Plugin-Name" attribute of the Plugin header.
This makes sub-plugins incompatible with WordPress (in case a user manually uploads it to the wrong folder) and also makes individual instances of the sub-plugin feature incompatible with each other to avoid confusion