0
下面是这种情况:如何将参数传递给apply_filters?
if(apply_filters('example_filter', false, $type)) {
// do something
}
我要让$type
提供// do something
块内或从callback_function
通过。
$type = 'select';
function callback_function($bool, $type) {
return true;
}
add_filter('example_filter', 'callback_function', 10, 2);
如何传递从内部apply_filters
范围callback_function
的arguement?