[wp-hackers] add_filter() with multiple arguments
Eric Mann
eric at eamann.com
Mon Aug 23 17:11:55 UTC 2010
It's fairly easy to add a filter that accepts multiple parameters, but how do
you return those parameters?
Case-in-point:
http://wordpress.stackexchange.com/questions/741/how-can-i-filter-children-of-the-uncategorized-category-out-of-the-loop
The solution to this particular category problem is to add a filter to
'get_categories_taxonomy' which passes two arguments, $args['taxonomy'] and
$args. But what do you pass back in the return?
Will:
function exclude_children($taxonomy, $args) {
$args['exclude_tree'] => '1';
return $args;
}
add_filter('get_categories_taxonomy', 'exclude_children', 10, 2);
break anything when it executes? I've never added a filter that accepted
multiple arguments before, and the Codex documentation only addresses receiving
more than one argument, not passing them back ...
More information about the wp-hackers
mailing list