Skip to content

List of hooks

robiso edited this page Jan 4, 2018 · 15 revisions

Creating a plugin is easy

  • Each plugin has to be in it's own folder (example.com/plugins/pluginFolderName/).
  • Each plugin can have unlimited number of files.
  • WonderCMS will automatically include your plugin and plugin files.

List of available hooks/listeners

  • Listeners are ssed for attaching your functions to different parts of WonderCMS.
  • These hooks can be used inside your plugin PHP files (example.com/plugins/pluginFolderName/myPluginFileName.php).
 wCMS::addListener('page', 'yourFunctionName');
 wCMS::addListener('js', 'yourFunctionName');
 wCMS::addListener('css', 'yourFunctionName');
 wCMS::addListener('settings', 'yourFunctionName');
 wCMS::addListener('menu', 'yourFunctionName');
 wCMS::addListener('getMenuSettings', 'yourFunctionName');
 wCMS::addListener('footer', 'yourFunctionName');

Simple plugin example: hits counter plugin

How do I make my plugin downloadable by others?

  • Create a ZIP file of your plugin folder. If your plugin folder is "myAwesomePlugin", create a ZIP file of the "myAwesomePlugin" folder.
  • Upload ZIP file to GitHub (as a release file).
  • Anyone with your ZIP link will be able to install your plugin through the WonderCMS Settings panel.
Clone this wiki locally