From 3ef53aff6cb37d5aa9d33b2f2232844843f87802 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 23 Aug 2023 11:58:03 +0200 Subject: [PATCH] Allow hooks to be prefixed with HOOK_ --- system/libs/plugins.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/libs/plugins.php b/system/libs/plugins.php index d06ddf41..c1d458e1 100644 --- a/system/libs/plugins.php +++ b/system/libs/plugins.php @@ -152,6 +152,10 @@ class Plugins { foreach(self::getAllPluginsJson() as $plugin) { if (isset($plugin['hooks'])) { foreach ($plugin['hooks'] as $_name => $info) { + if (str_contains($info['type'], 'HOOK_')) { + $info['type'] = str_replace('HOOK_', '', $info['type']); + } + if (defined('HOOK_'. $info['type'])) { $hook = constant('HOOK_'. $info['type']); $hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];