Support Forum
Edit: Topic should be "Filter idea" not hook. Sorry.
Is is possible, or reasonable to consider adding a second argument to filters that are near the end of a function?
Example: apply_filters('sph_ProfileEditButton', $out) allows you filter, modify or even replace output before it's returned. I'd like to see apply_filters('sph_ProfileEditButton', $out, $a) so the arguments are exposed for lot's of reasons. I'm loving we are usings wp_parse_args. And that we can add unlimited extra args because of it. But it's wasted if we can't access the args later. 🙁
it is a hook... filters and actions make up hooks...
I thought we had put the args array in most of those template tags hooks... I agree they should be there - the one you reference clearly is not...
will trawl through them and add...
Visit Cruise Talk Central and Mr Papa's World
looked like about 50% had them and 50% did not... that will teach us to follow our own standards!
Visit Cruise Talk Central and Mr Papa's World
yes, they are before the echo.. and yes, users need to sanitize - good point to document... this is just like the filter on the args themselves...
Visit Cruise Talk Central and Mr Papa's World
I am so loving the change!
However I had forgotten how to add_filter for extra arguments. A new pot of coffee is a Godsend.
For the boneheaded like me, this example will handle one argument (most common usage):
add_filter('sph_ExampleFilter', 'myExampleFilterFunction');
This example will handle 2 args. Edit '2' to handle more if filter supports:
add_filter('sph_ExampleFilter', 'myExampleFilterFunction', '', '2');
1 Guest(s)