[wp-hackers] do_action with multiple arguments

Kimmo Suominen kim at tac.nyc.ny.us
Thu Mar 10 18:05:34 GMT 2005


Hmm, this could be related to a problem I've started seeing with Spam
Karma (0.19 alpha 1), but haven't been successful in tracking yet:

    WordPress database error: [You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for
    the right syntax to use near '' at line 1]

    SELECT * FROM wp_comments WHERE comment_ID =

    WordPress database error: [You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for
    the right syntax to use near '' at line 1]

    UPDATE wp_comments SET comment_content = '' WHERE comment_ID =

The empty comment ID just made me think this could be it.

Upgrading to SK 0.20 alpha 2 broke comments completely (nothing ever
gets into the DB, and the page just comes back as if no comment was
submitted).

Running WP svn rev 2423 (should run svn update again).

Regards,
+ Kim
-- 
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>


On Thu, Mar 10, 2005 at 12:15:42PM -0500, Daniel Westermann-Clark wrote:
> Hi,
> 
> I've been working on extending the authentication API available to
> plugins.  Matt committed my changes yesterday:
> 
> http://trac.wordpress.org/changeset/2425
> 
> I'm now trying my authentication plugin against trunk, and seem to be
> running into an issue related to the changes in issue 901:
> 
> http://mosquito.wordpress.org/view.php?id=901
> http://trac.wordpress.org/changeset/2398
> 
> The do_action function is now passing an empty argument, $string, to
> plugin callbacks (line 969 of wp-includes/functions.php).
> 
>     $all_args = array_merge(array($string), $args);
>     [...]
>     $string = call_user_func_array($function_name, $args);
> 
> The string is never returned or used outside of do_action, so I'm
> wondering about its purpose.  You end up needing to accept an additional
> argument than the actual do_action call gives.  Here's a simplified
> example from my HTTP authentication plugin:
> 
>     add_action('wp_authenticate', 'login', 10, 3);
>     function login($string, $username, $password) {
>         $username = $_SERVER['REMOTE_USER'];
>         $password = $username;
>     }
> 
> This works, but is the $string argument necessary for actions (as
> opposed to filters, where it does make sense)?  I'm probably just
> missing something, so I thought it best to ask.
> 
> Thanks,
> -- 
> Daniel Westermann-Clark
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 


More information about the wp-hackers mailing list