admin管理员组文章数量:1332395
I have created a custom login and registration page with the plugin 'User Registration' and they both work perfectly fine, however, on the login page if I click on the ‘Forgot password’ link, it takes me to the default WordPress password reset page. Is there any way to redirect to a custom page that I have created for this purpose?
Thank you in advance.
Kind regards, Nora
I have created a custom login and registration page with the plugin 'User Registration' and they both work perfectly fine, however, on the login page if I click on the ‘Forgot password’ link, it takes me to the default WordPress password reset page. Is there any way to redirect to a custom page that I have created for this purpose?
Thank you in advance.
Kind regards, Nora
Share Improve this question asked Jul 8, 2020 at 7:52 NoraNora 1 2- Does this answer your question? How to change/rewrite the lost password url? – Jacob Peattie Commented Jul 8, 2020 at 8:37
- Please share the plugin link. – Arpita Hunka Commented Jul 8, 2020 at 14:50
1 Answer
Reset to default 1Yep, there's a hook to change the lost password URL.
I found it by going to this nice page to search all the hooks and filters and selecting 'Hooks' and trying 'lost password' https://developer.wordpress/reference/
An example from here: https://codex.wordpress/Plugin_API/Filter_Reference/lostpassword_url
add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );
function my_lost_password_page( $lostpassword_url, $redirect ) {
return home_url( "/yournew/lostpasswordpage.php" );
}
本文标签: phpRedirecting to a custom forgot password page
版权声明:本文标题:php - Redirecting to a custom forgot password page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742283555a2446531.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论