• ryanschwartz

    (@ryanschwartz)


    I’m updating the imap_authentication plugin to work with 2.1 and up.

    However, when doing
    add_action('wp_authenticate', array('IMAPAuthentication', 'login'));
    in the class, then in the IMAPAuthentication classes login function:
    function login($username,$password) {
    to capture the username and password.

    The problem is that wp-login.php is not passing in the password reference even though it is supposed to:
    (from wp-login.php)
    do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass));

    Any ideas what’s going on here?!?

Viewing 2 replies - 1 through 2 (of 2 total)
  • mellertime

    (@mellertime)

    You didn’t hang around #wordpress long enough.

    You have to specify the number of arguments your function accepts (4th parameter for add_action):

    add_action(‘wp_authenticate’, ‘my_function’, 10, 2);

    Bingo: it works.

    Thread Starter ryanschwartz

    (@ryanschwartz)

    Zing! Thanks MellerTime.

    For anyone else running into this, the add_action reference page does indeed explain the usage.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_authentication not passing 2 arguments’ is closed to new replies.