mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-17 16:21:25 +02:00
Hook can return values
This commit is contained in:
parent
710ef7e9fa
commit
5baac9d7d0
1 changed files with 3 additions and 2 deletions
|
@ -45,13 +45,14 @@ function register_hook($action, $function){
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_hook($action){
|
function run_hook($action, $args = []){
|
||||||
global $hook_registered;
|
global $hook_registered;
|
||||||
foreach($hook_registered as $hook){
|
foreach($hook_registered as $hook){
|
||||||
if($hook['action'] == $action){
|
if($hook['action'] == $action){
|
||||||
if(function_exists($hook['function'])){
|
if(function_exists($hook['function'])){
|
||||||
call_user_func($hook['function']);
|
return call_user_func($hook['function'], $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue