SynaKyra博客注册无需等待
由于姐姐Jade,日前在本博客注册时发现收不到密码邮件,然后经我测试确实是收不到。。我很郁闷,因为博客搭建的时候我测试了邮件服务器是完好的。我也不知道是哪里出错了。为了解决这个问题,我直接在注册成功页面显示密码。
修正日记:
打开wp-login.php:
1、搜索下面这句,位于 register_new_user 函数中。用于注册成功后发送通知。找到后把它注释掉。
wp_new_user_notification($user_id, $user_pass);
并在上面这句的下一行加上两句:
setcookie("u", $user_login);
setcookie("user_pass", $user_pass);
目的是把注册时填写的用户名,以及wordpress随机生成的密码写入cookies,以便在后面调用。
2、搜索下面这句:
$errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
并把它替换为:
$errors->add('registered', __('Registration complete. User:'.$_COOKIE["u"].' Password:'.$_COOKIE["user_pass"].'(Please Modify your password as soon as possible)'), 'message');
3、还有一处建议修改
<?php _e('A password will be e-mailed to you.') ?>
替换里面的文字,以防用户注册完毕后关闭注册页而收不到密码。
我替换的文字为
<?php _e('After Registration,Password will be shown on this page.') ?>
到此,就修改完成了。保存,上传。
若未注明,本博客文章均为原创,转载请以链接形式标明本文地址
本文地址:http://skday.com/archives/205/

