From 5ed5c76d3f2628ffec348a61c681c86730e383de Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 1 May 2017 18:02:00 -0700 Subject: new function Hook::register_array() to bulk register several hooks from the same file with default settings --- Zotlabs/Extend/Hook.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Zotlabs/Extend') diff --git a/Zotlabs/Extend/Hook.php b/Zotlabs/Extend/Hook.php index fef3ebe9b..c6f9ea850 100644 --- a/Zotlabs/Extend/Hook.php +++ b/Zotlabs/Extend/Hook.php @@ -40,6 +40,15 @@ class Hook { return $r; } + static public function register_array($file,$arr) { + if($arr) { + foreach($arr as $k => $v) { + self::register($k,$file,$v); + } + } + } + + static public function unregister($hook,$file,$function,$version = 1,$priority = 0) { if(is_array($function)) { $function = serialize($function); -- cgit v1.2.3