[英]How to change default email reset link for the WordPress reset a password
WordPress用户注册,密码重置电子邮件使用的是pluggable.php文件。 (/wp-includes/pluggable.php)。 有两种方法可以实现您的请求。
修改/wp-includes/pluggable.php文件。 :不是首选/建议,而是一种简单的方法。 对于上面的示例,修改行号1903(参考分支5.0.2 https://core.trac.wordpress.org/browser/tags/5.0.1/src/wp-includes/pluggable.php#L0 )
使用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.