Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

The action is called without any variables:

do_action('admin_notices');

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
add comment

Your Answer

 
discard

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.