From 456fe71ca9b768980f578494ee39c46cba946bc8 Mon Sep 17 00:00:00 2001 From: "M.Dent (DM42.Net)" Date: Wed, 19 Sep 2018 21:54:46 -0400 Subject: add hook: permit_hook --- include/plugin.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 9757be356..2239f017d 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -458,6 +458,18 @@ function call_hooks($name, &$data = null) { if (isset(App::$hooks[$name])) { foreach(App::$hooks[$name] as $hook) { + + if ($name != 'permit_hook') { // avoid looping + $checkhook = [ + 'name'=>$name, + 'hook'=>$hook, + 'permit'=>true + ]; + call_hooks('permit_hook',$checkhook); + if (!$checkhook['permit']) { + continue; + } + } $origfn = $hook[1]; if($hook[0]) @include_once($hook[0]); -- cgit v1.2.3