mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
Allow hooks to be prefixed with HOOK_
This commit is contained in:
parent
f1670f4012
commit
063cbab93e
@ -74,6 +74,10 @@ class Plugins {
|
||||
if (isset($plugin['hooks'])) {
|
||||
foreach ($plugin['hooks'] as $_name => $info) {
|
||||
if (defined('HOOK_'. $info['type'])) {
|
||||
if (str_contains($info['type'], 'HOOK_')) {
|
||||
$info['type'] = str_replace('HOOK_', '', $info['type']);
|
||||
}
|
||||
|
||||
$hook = constant('HOOK_'. $info['type']);
|
||||
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user