Creating a plugin

  • Your plugin folder must reside in the plugins folder (example.com/plugins/plugin-name).
  • IMPORTANT: plugin-name.php must have the same name as the plugin folder name.
    • For example, if your plugin folder name is plugin-name, then the main file should also be plugin-name.php.
  • WonderCMS will automatically include your plugin.

List of available listeners/hooks

  • Listeners are used for attaching your functions to different parts of WonderCMS.
  • These hooks can be used inside your plugin PHP files (example.com/plugins/pluginFolderName/pluginFolderName.php).
 $Wcms->addListener('page', 'yourFunctionName'); // attach your function to the page
 $Wcms->addListener('js', 'yourFunctionName'); // can be used for additional JavaScript
 $Wcms->addListener('css', 'yourFunctionName'); // can be used for additional CSS
 $Wcms->addListener('settings', 'yourFunctionName'); // can be used for additional admin settings
 $Wcms->addListener('menu', 'yourFunctionName'); // attach your function to the menu
 $Wcms->addListener('getMenuSettings', 'yourFunctionName');
 $Wcms->addListener('footer', 'yourFunctionName'); // attach your function to the footer