WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

do you know why i am missing argument 2 for this function?

add_action( 'admin_notices', 'notice_handler', 10, 2);

function notice_handler($error_token, $error_tag) {


but when i activate the plugin wp says: Warning: Missing argument 2 for notice_handler()....

share|improve this question

The action is called without any variables:


So you don’t get $error_token and $error_tag.

share|improve this answer
Thank you, I was actually trying to look for the number of variables which it can have. So can I ask if i can replace that action with another? Basically I'm trying to make a plugin which handles the errors of some of my custom plugins. – Tony Feb 16 '12 at 15:04
Why can't you just invoke those variables inside your callback? – Chip Bennett Feb 16 '12 at 15:08
No, because the others plugins when find an error set an option with option_update. Now in the function hooked by <CODE>do_action('admin_notices');</CODE> in another plugin i would like to be able to retrieve the name of the option and so pass it to get_option($var). Is that possible....i may be wrong on this. – Tony Feb 16 '12 at 15:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.