WordPress.org

Ready to get started?Download WordPress

Forums

Incomplete action hooks @ wp-login.php ? (8 posts)

  1. Geert
    Member
    Posted 3 years ago #

    Hello,

    The following action hooks @ wp-login.php should also pass the user variable:

    1.
    $message = apply_filters('retrieve_password_message', $message, $key);
    -> Also pass $user_login
    $user_login is needed to build the URL the user needs to click to confirm the password reset request.

    2.
    $message = apply_filters('password_reset_message', $message, $new_pass);
    -> Also pass $user->user_login
    When sending the new password, we need to display the username that goes with it.

    (Maybe I missed something...)

    Best,

    Geert

  2. Geert
    Member
    Posted 3 years ago #

    Hello,

    I wonder if anyone manages to use these hooks without the proposed fix.

    $user_login and $user->user_login are not available (global), so I guess the only way is to add them to the code @ wp-login.php:

    $message = apply_filters('retrieve_password_message', $message, $key, $user_login);

    and

    $message = apply_filters('password_reset_message', $message, $new_pass, $user->user_login);

    Geert

  3. What are you trying to achieve with all this?

    There's a built in way to reset your password.

  4. Geert
    Member
    Posted 3 years ago #

    Hello,

    We're building sites for our clients. We need to personalize the standard e-mails sent by WP. E.g. client-specific messages, multilingual (using qTranslate), client-specific contact details for help, ...

    So yes using the built-in process, but adapting the e-mail subject and content. I guess that's what these hooks were designed for.

    Geert

  5. Geert
    Member
    Posted 3 years ago #

    Hello,

    Thanks. I've been exploring a bunch of plugins previously, yet none seemed to use these hooks. I will check them again asap.

    G.

  6. Geert
    Member
    Posted 3 years ago #

    Hello, I checked the plugins. They all require a modification of wp-login.php, to add a 3rd parameter to the hook calls:

    Can't we have the wp-login.php edited to something like:

    $message = apply_filters('retrieve_password_message', $message, $key, $user_login);
    and
    $message = apply_filters('password_reset_message', $message, $new_pass, $user->user_login);

    It's backwards OK and will benefit all new coding.

    Best,

    Geert

  7. Submit that to trac.wordpress.org

Topic Closed

This topic has been closed to new replies.

About this Topic