Executes functions hooked to a specific action hook.
<?php $app->hook->do_action($hook, $arg); ?>
$hook: (string) (required) The name of the hook that should be executed.
$arg: (mixed) (optional) Additional arguments passed to functions hooked to the action.
$app = \Liten\Liten::getInstance(); /** * Hook with an argument. */ $app->hook->do_action('my_custom_hook', $arg); function my_custom_function($arg) { var_dump($arg); } $app->hook->add_action('my_custom_hook', 'my_custom_function', 10, 1);
Since 1.0.0
$app->hook->do_action() is located in app/src/Hooks.php.