doActions()
doActions(array $arrActionHooks, mixed $vArgs1, mixed $vArgs2, mixed $_and_more) : void
Triggers the do_action() function with the given action names and the arguments.
This is useful to perform do_action() on multiple action hooks with the same set of arguments.
For example, if there are the following action hooks, action_name, action_name1, and action_name2, and to perform these, normally it takes the following lines.
do_action( 'action_name1', $var1, $var2 );
do_action( 'action_name2', $var1, $var2 );
do_action( 'action_name3', $var1, $var2 );
This method saves these line this way:
$this->doActions( array( 'action_name1', 'action_name2', 'action_name3' ), $var1, $var2 );
Example
$this->doActions( array( 'action_name1' ), $var1, $var2, $var3 );
Parameters
array | $arrActionHooks | a numerically indexed array consisting of action hook names to execute. |
mixed | $vArgs1 | an argument to pass to the action callbacks. |
mixed | $vArgs2 | another argument to pass to the action callbacks. |
mixed | $_and_more | add as many arguments as necessary to the next parameters. |