﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
22218	Extra add_action() parameter	dgwyer		"Unless I am missing something really obvious here, this ticket makes a lot of sense to me.

---

There have been many instances where I have wanted to optionally pass my own parameters to hook callback functions, that __haven't__ been specified in the hooks {{{do_actions()}}} function call.

It would be hugely beneficial to also be able to pass in an array (say) as an extra parameter when using {{{add_action()}}}. Something like:

{{{
$extra_args = array( 'value1', 'value2', 'value3' );
add_action( $hook, $callback, $priority, $accepted_args, $extra_args );
}}}

Then, in the callback function the {{{$extra_args}}} array would be accessible as well as any {{{$accepted_args}}} parameters. Maybe make it easy to access by always making it the last parameter?

{{{
function my_callback($wp1, $wp2, $args) {
    //$args[0] = 'value1';
    //$args[1] = 'value2';
    //$args[2] = 'value3';
}
$extra_args = array( 'value1', 'value2', 'value3' );
add_action( 'some_hook', 'my_callback', 10, 2, $accepted_args, $extra_args );
}}}

Note: I know I can achieve the same thing using global vars, but I don't really want to define them unnecessarily when using a parameter would make more sense."	enhancement	closed	normal		General	3.4.2	normal	duplicate	2nd-opinion	
