When registering a user with WordPress, the password is usually sent to the mailbox by email. But in many cases, for example, some servers do not support the mail function. There are also some mailbox problems, network problems, and so on, resulting in failure to send emails.
This section describes how to send an email when registering a user and display the password immediately after registration. After successful registration, the password is displayed.
Two birds in one fell swoop.
After successful registration, the password is displayed.
1. Find the wp-login.php file in the WordPress root directory
2. Find "wp_new_user_notification" and add two lines below
Wp_new_user_notification ($ user_id, $ user_pass );
Setcookie ("u", $ user_login );
Setcookie ("user_pass", $ user_pass); these two rows are used to record the user name and password.
3. Find
Elseif (isset ($ _ Get ['checkemail']) & 'registered' == _ Get ['checkemail'])
$ Errors-> Add ('registered', _ ('registration complete. Please check your e-mail. '), 'message'); changed
Elseif (isset ($ _ Get ['checkemail']) & 'registered' == _ Get ['checkemail'])
$ Errors-> Add ('registered', _ ('Congratulations, registration successful <br/> username/User :'. $ _ cookie ['U']. '<br/> password & nbsp; Code/password :'. $ _ cookie ['user _ pass']. '<br/> (change the password to a password that is easy to remember after logon )'));~ Complete.
PS: if the package contains Chinese characters, as shown above. Save it as utf8 format.