+30.2152151245-8 abuse@cms39.com

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_routesnew URL routes
cms39_settings_uilabels / help for your plugin settings
cms39_cli_commandsnew CLI commands
cms39_webhooksnew webhooks
cms39_menu_treechange a menu before rendering
cms39_robots_rulesrobots.txt rules
linkTypesadmin 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).

for more information contact us by
E-MAIL or by phone at (+30) +30.2152151245-8