-
-
Notifications
You must be signed in to change notification settings - Fork 165
List of hooks
Robert Isoski edited this page Jul 25, 2022
·
15 revisions
- 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 beplugin-name.php
.
- For example, if your plugin folder name is
- WonderCMS will automatically include your plugin.
- 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');
$Wcms->addListener('menu', 'yourFunctionName');
$Wcms->addListener('getMenuSettings', 'yourFunctionName');
$Wcms->addListener('footer', 'yourFunctionName');
Plugin example: hits counter
- A few simple steps with the help of Custom modules
- 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');
wCMS::addListener('menu', 'yourFunctionName');
wCMS::addListener('getMenuSettings', 'yourFunctionName');
wCMS::addListener('footer', 'yourFunctionName');
Plugin example: hits counter
- A few simple steps with the help of Custom repositories
Still need help?
- Ask a question or make a request in the community.
- Official website
Intro
- Home
- Demo
- Download
- One step install
- Requirements
- 5 file structure
- List of hooks
- Included libraries
- Create theme in 8 easy steps
- Create a plugin
- Custom modules
- Translations
- All security features described
Basic how to's
- Backup all files
- Change default login URL
- Change default password
- Create custom page template
- Create new editable areas or editable blocks
- Edit 404 page
- Get data from database
- Set data to database
- Hide page from menu
- Caddy web server config
- IIS server config
- NGINX server config
- Login
- Recover login URL
- Reset password
- Restore backup
- Update
- PHP built in server
Themes
- Create theme in 8 easy steps
- Add favicon
- Theme tags
- Update theme to work with WonderCMS 2.0.0
- Update theme to work with WonderCMS 3.0.0
- Share your themes with Custom modules
Plugins
- Quick intro on creating plugins and List of hooks
- Share your plugin with simply with Custom modules
Security
- All security features described
- Add SRI tags to your theme libraries
- Always redirect to https and www
- Additional security configuration(s)
- Add SRI tags to your theme libraries
- Better security mode (HTTPS and other features)
Features description
- One click update
- Optional: functions.php file
- Default database.js
- Allowed extensions file types for uploads
- Login URL doesn't work - 404
- 500 internal server error
- Persistent "New WonderCMS update available" message
- URLs mailformed on Windows IIS
- Other errors