簡體   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