Well, learn to create a wordpress plugin, I downloaded one and read the codes, and I saw this. I assume that "foo" is the tag into which the action will be added.
but what exactly does array () do?
add_action('foo', array('foo1', 'foo2'));
I looked at http://codex.wordpress.org/Function_Reference/add_action and there is no clear definition about this.
That's right, the first argument is the tag (to which you will add the action), and the second argument indicates the function to call (i.e. your callback).
PHP , , . :
PHP- -
, , 2. , , .
, , , , , , foo(), foo1->foo2().
foo()
foo1->foo2()
add_action - , hook.
add_action
function hello_header() { echo "I'm in the header!"; } add_action('wp_head', 'hello_header');
- , .
, call_user_func. .
call_user_func
http://us2.php.net/manual/en/language.pseudo-types.php#language.types.callback
Source: https://habr.com/ru/post/1762221/More articles:Attempting to install MetaTag dynamically - javascriptHow to determine the number of processor cores on a PC? - sasDoes perl have a +/- infinity equivalent for string comparisons? - stringgoing to git repo from second machine [Github] - gitProblem with adding braids - clojureпередача массива в намеренный андроид - androidHow to limit connection in Linux socket programming? - cHow to set up a UIView touch handler without a subclass - objective-cКонтрольные переменные интерфейса - oopMaster Page Callbacks - asp.netAll Articles