WordPress.org

Make WordPress Core

Changeset 8489


Ignore:
Timestamp:
07/29/2008 08:21:34 PM (10 years ago)
Author:
westi
Message:

Make lost password admin notification pluggable. Fixes #7430 props error.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r8324 r8489  
    991991endif;
    992992
     993if ( !function_exists('wp_password_change_notification') ) :
     994/**
     995 * Notify the blog admin of a user changing password, normally via email.
     996 *
     997 * @since 2.7
     998 *
     999 * @param object $user User Object
     1000 */
     1001function wp_password_change_notification(&$user) {
     1002    // send a copy of password change notification to the admin
     1003    // but check to see if it's the admin whose password we're changing, and skip this
     1004    if ( $user->user_email != get_option('admin_email') ) {
     1005        $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
     1006        wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message);
     1007    }
     1008}
     1009endif;
     1010
    9931011if ( !function_exists('wp_new_user_notification') ) :
    9941012/**
  • trunk/wp-login.php

    r8454 r8489  
    191191        die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
    192192
    193     // send a copy of password change notification to the admin
    194     // but check to see if it's the admin whose password we're changing, and skip this
    195     if ( $user->user_email != get_option('admin_email') ) {
    196         $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
    197         wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message);
    198     }
     193    wp_password_change_notification($user);
    199194
    200195    return true;
Note: See TracChangeset for help on using the changeset viewer.