New WordPress registration process has changed,It does not require users to enter their own password to apply for registration,But in turn sent to the user's mailbox password recovery link。
This has the advantage of avoiding some of the security risks associated with the mailbox but also the way。but,Such has been further requirements for these structures WordPress bloggers technology,such as:
Need to configure their own mailbox - if your space is not provided, then the mailbox,Typically the server on behalf of,Such mail is very easy to get into the junk mail list - and some even directly receive the。If you own vps,Then you have to build a variety of services --php comes transmit functions are not so perfect。
In short,We have all the solutions of these problems。
Here,I encountered a situation will only occur occasionally,In this time built cnswift.org,Many people have to register,They differ with my work environment,So registered e-mail is not the same,The activation link is sent by WordPress <https://www.logcg.com/xxxxxx> Send the form,So for some of the less good for the mailbox,Links are not resolved to https://www.logcg.com/xxxxxx But strange https://www.logcg.com/xxxxxx> 。
It is little wonder will always be some people told me:
"Sorry,The key appears to be invalid. "
Got it。
It seems WP old bug perennial since,but,We can fix it manually,Change the system file is not a good idea - after all,,WordPress Upgrade now quite frequent。
We wrote a small plug-in can be in function.php,Other,Most seem to fall off as the current topic Gerber made a sub-theme - does not cost anything,But you can avoid after updating the theme in order to retain or re-configure configuration can not update。
In short,In your function.php end of the file add the following code to:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
/** * WordPress忘记密码发送的邮件中点击找回链接提示“抱歉,该 key 似乎无效” */ function reset_password_message( $message, $key ) { if ( strpos($_POST['user_login'], '@') ) { $user_data = get_user_by('email', trim($_POST['user_login'])); } else { $login = trim($_POST['user_login']); $user_data = get_user_by('login', $login); } $user_login = $user_data->user_login; $msg = __('有人要求重设如下帐号的密码:'). "\r\n\r\n"; $msg .= network_site_url() . "\r\n\r\n"; $msg .= sprintf(__('用户名:%s'), $user_login) . "\r\n\r\n"; $msg .= __('若这不是您本人要求的,请忽略本邮件,一切如常。') . "\r\n\r\n"; $msg .= __('要重置您的密码,请打开下面的链接:'). "\r\n\r\n"; $msg .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') ; return $msg; } add_filter('retrieve_password_message', reset_password_message, null, 2); |
This time,Send mail box will not have that annoying on <> Up!
Further reading
http://www.chencao.com/575.html
Original article written by LogStudio:R0uter's Blog » WordPress Forgot your password message "Sorry,The key appears to be invalid. "
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1433.html