[wp-trac] Re: [WordPress Trac] #5941: PHP error "Missing
argument..." occurs in update_option_ action
WordPress Trac
wp-trac at lists.automattic.com
Thu Feb 21 05:01:55 GMT 2008
#5941: PHP error "Missing argument..." occurs in update_option_ action
---------------------+------------------------------------------------------
Reporter: softwud | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.6
Component: General | Version: 2.3.2
Severity: major | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment (by softwud):
Thanks DD32, I was just working through the source and came to the same
conclusion... boy do I feel red faced! I read the documentation on the
action that says that it passes two arguments... I didn't stop to think
that I needed to tell it how many options to pass. Sorry for being such an
idiot. It's obviously no longer a problem.
Regards,
Paolo
Replying to [comment:1 DD32]:
> how are you defining your hook?
>
> Are you specifying that your hook accepts 2 params?
>
> {{{
> add_action ( 'hook_name', 'your_function_name', [priority],
[accepted_args] );
> }}}
>
> So, If you want to accept 2 args:
> {{{
> add_action ( 'update_option_XX', 'funcName', 10, 2 );
> }}}
--
Ticket URL: <http://trac.wordpress.org/ticket/5941#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list