首次定义位置:
根目录\wp-includes\plugin.php line27
/** @var WP_Hook[] $wp_filter */
global $wp_filter, $wp_actions, $wp_current_filter;
$wp_filter 是一个多维数组,保存了目前所有的已注册在挂钩上的函数的信息。把它扩展开可以看到这样子的结构:
$wp_filter=array(
'挂钩名'=>array(
'优先级'=>array(
'函数1'=>array(
'function'=>"函数名",
'accepted_args'=>"函数接受的参数数量"
),
'对象'=>array(
'function'=>array(
'0'=>'对象的引用',
'1'=>'对象上的方法'
),
'accepted_args'=>"方法接受的参数数量"
)
)
)
);
end.