Hooks let you change how the core and plugins behave without touching their code, so your changes survive every update.
Filters and actions
// filter: receives a value and returns the changed one
add_filter('cms39_search_results_structure', fn($tpl) => '<div class="row">%results$s</div>%pagination$s');
// action: runs at a point, no return value
add_action('cms39_cli_cron', function () {
// scheduled task
});
// more arguments: priority, number of arguments
add_filter('cms39_settings_saved', fn($notes, $new) => $notes, 10, 2);Some places use the HookManager (e.g. cms39_fields_register, cms39_admin_sidebar_menu, e-shop hooks):
HookManager::addHook('cms39_admin_sidebar_menu', function (array $groups) {
$groups['theme']['items'][] = ['label' => 'Guide', 'icon' => 'bi bi-book', 'url' => cp_URL . 'cp_loader?page=mod_admin_guide'];
return $groups;
});Common hooks
cms39_routes | new URL routes |
cms39_settings_ui | labels / help for your plugin settings |
cms39_cli_commands | new CLI commands |
cms39_webhooks | new webhooks |
cms39_menu_tree | change a menu before rendering |
cms39_robots_rules | robots.txt rules |
linkTypes | admin form for your own content type |
The complete list, with where each hook is defined and listened to, is generated from the code (php cms39 docs:index).
E-MAIL or by phone at (+30) +30.2152151245-8