aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Extend
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-05-01 18:02:00 -0700
committerzotlabs <mike@macgirvin.com>2017-05-01 18:02:00 -0700
commit5ed5c76d3f2628ffec348a61c681c86730e383de (patch)
tree43ad4295043df08a33553c21f93e17c748aeac01 /Zotlabs/Extend
parentfe2288a88ffd08ff0fefa9945ebb062ca85aa9d8 (diff)
downloadvolse-hubzilla-5ed5c76d3f2628ffec348a61c681c86730e383de.tar.gz
volse-hubzilla-5ed5c76d3f2628ffec348a61c681c86730e383de.tar.bz2
volse-hubzilla-5ed5c76d3f2628ffec348a61c681c86730e383de.zip
new function Hook::register_array() to bulk register several hooks from the same file with default settings
Diffstat (limited to 'Zotlabs/Extend')
-rw-r--r--Zotlabs/Extend/Hook.php9
1 files changed, 9 insertions, 0 deletions
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);