well im learning to produce a wordpress wordpress plugin i downloaded one and browse the codes, and that i saw this i suppose 'foo' may be the tag where it'll add action to..

but exactly what does the array() exactly do?

add_action('foo', array('foo1', 'foo2'));

i checked out http://codex.wordpress.org/Function_Reference/add_action and there's no obvious definition about this ..

The 2nd argument from the add_action function may be the function to become known as using the hook.

function hello_header() {
 echo "I'm in the header!"; 

add_action('wp_head', 'hello_header');

Using an assortment because the second argument would be to pass a objects method as opposed to just a normal function.

Possess a educate yourself around the the way the call_user_func works. Ought to provide more insight.


Right, the very first argument may be the tag (that you will be adding the experience), and also the second argument identifies the function to call (i.e. your callback).

The 2nd argument consumes a PHP callback, and therefore, accepts numerous valid forms. Look at this its them :

PHP Callback Pseudo-Types

The kind you've proven above is of type 2. The very first component of the array identifies a category, and also the second element identifies which purpose of the course you want to call.

So using the example you've given above, what that is going to do is the fact that, whenever the foo() action is known as, it is going to call foo1->foo2() too.