繁体   English   中英

如何更改WordPress的默认电子邮件重置链接以重置密码

[英]How to change default email reset link for the WordPress reset a password

我想更改默认的WordPress电子邮件URL,以便在用户注册后不将其定向到wp-login.php页面,而是另一个页面。

下面的屏幕快照显示了WordPress电子邮件中包含我要更改的URL的部分;

包含默认登录页面URL的WordPress电子邮件屏幕截图

我该如何实现?

WordPress用户注册,密码重置电子邮件使用的是pluggable.php文件。 (/wp-includes/pluggable.php)。 有两种方法可以实现您的请求。

  1. 修改/wp-includes/pluggable.php文件。 :不是首选/建议,而是一种简单的方法。 对于上面的示例,修改行号1903(参考分支5.0.2 https://core.trac.wordpress.org/browser/tags/5.0.1/src/wp-includes/pluggable.php#L0

  2. 使用functions.php扩展功能在以下示例中,用户通知会将用户重定向到其他URL。

     add_filter( 'wp_new_user_notification_email', 'custom_wp_new_user_notification_email', 10, 3 ); function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname ) { $wp_new_user_notification_email['subject'] = sprintf( '[%s] New user %s registered.', $blogname, $user->user_login ); $wp_new_user_notification_email['message'] = sprintf( "%s ( %s ) has registerd to your blog %s.", $user->user_login, $user->user_email, "To Change your password visit: https://google.com" ); return $wp_new_user_notification_email; } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM