函数原型
apply_filters_ref_array( string $hook_name, array $args ): mixed
函数描述
Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
是否弃用
未弃用
函数参数
-
$hook_name
string
Required - The name of the filter hook.
-
$args
array
Required - The arguments supplied to the functions hooked to
$hook_name.
函数返回值
mixed The filtered value after all hooked functions are applied to it.
函数位置
File: wp-includes/plugin.php.
函数源码
add_filter('my_filter', 'my_callback');
function my_callback( $args ) {
//access values with $args[0], $args[1] etc.
}源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

