函数原型
do_action_ref_array( string $hook_name, array $args )
函数描述
Calls the callback functions that have been added to an action hook, specifying arguments in an array.
是否弃用
未弃用
函数参数
-
$hook_name
string
Required - The name of the action to be executed.
-
$args
array
Required - The arguments supplied to the functions hooked to
$hook_name.
函数返回值
无
函数位置
File: wp-includes/plugin.php.
函数源码
add_action('my_action', 'my_callback');
function my_callback( $args ) {
//access values with $args[0], $args[1] etc.
}源码链接
变更日志
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |

