do_action_array

Description

Executes functions hooked to a particular hook with supplied arguments. This method is identical to the do_action().

Usage

<?php $app->hook->do_action_array($hook, $args); ?>

Parameters

$hook: (string) (required) The name of the action to which $function_to_add is hooked. (See Action Reference for a list of action hooks).

$args: (array) (required) Arguments hooked to $hook.

Example

Call an action and pass an array of arguments

$app = \Liten\Liten::getInstance();

$args = ['arg_1', 'arg_2', 'arg_3'];

$app->hook->do_action_array('hook_action', $args);

The above example is the same as:

$app = \Liten\Liten::getInstance();

$app->hook->do_action( 'hook_action', 'arg_1', 'arg_2', 'arg_3' );

Change Log

Since 1.0.0

Source File

$app->hook->do_action_array() is located in app/src/Hooks.php.