How to call do_action() to pass arguments to hooked functions that take different number of args?

All the additional arguments passed to do_action() are passed as arguments, in order, to any hooked callback function. The callback functions can only choose how many of them to use, by setting the $accepted_args parameter of add_action(). They can’t choose which arguments to accept. So you would need to do something like this: add_action(‘myaction’, ‘my_multiplication’, … Read more