new function Hook::register_array() to bulk register several hooks from the same file with default settings
This commit is contained in:
parent
fe2288a88f
commit
5ed5c76d3f
@ -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);
|
||||
|
Reference in New Issue
Block a user