new function Hook::register_array() to bulk register several hooks from the same file with default settings

This commit is contained in:
zotlabs 2017-05-01 18:02:00 -07:00
parent fe2288a88f
commit 5ed5c76d3f

View File

@ -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);