admin管理员组文章数量:1207726
I used iThemes Security (formerly Better WP Security) hide back-end functionality to change the login url to /signin however clicking the lost password link /wp-login.php?action=lostpassword now generate a 404
Manually going to /signin?action=lostpassword works.
I came across the following code below which is suppose to make the change to however after some testing it doesn't seem to work
//*******************************************************
//Function to change to lost password url
//********************************************************
add_filter('site_url', 'wplogin_filter', 10, 3);
function wplogin_filter( $url, $path, $orig_scheme ){
$old = array( "/(wp-login\.php)/");
$new = array( "signin/"); //this can be change to login or whatever or may remain there
return preg_replace( $old, $new, $url, 1);
}
add to .htaccess
RewriteRule ^signin$ wp-login.php
How can i modify the above code in order to change the url for the lost password?
I used iThemes Security (formerly Better WP Security) hide back-end functionality to change the login url to /signin however clicking the lost password link /wp-login.php?action=lostpassword now generate a 404
Manually going to /signin?action=lostpassword works.
I came across the following code below which is suppose to make the change to however after some testing it doesn't seem to work
//*******************************************************
//Function to change to lost password url
//********************************************************
add_filter('site_url', 'wplogin_filter', 10, 3);
function wplogin_filter( $url, $path, $orig_scheme ){
$old = array( "/(wp-login\.php)/");
$new = array( "signin/"); //this can be change to login or whatever or may remain there
return preg_replace( $old, $new, $url, 1);
}
add to .htaccess
RewriteRule ^signin$ wp-login.php
How can i modify the above code in order to change the url for the lost password?
Share Improve this question asked Sep 19, 2014 at 2:41 OudinOudin 4194 gold badges9 silver badges18 bronze badges1 Answer
Reset to default 18the solution is simple, there is a filter to change the lost password url. Try this :
add_filter( 'lostpassword_url', 'wdm_lostpassword_url', 10, 0 );
function wdm_lostpassword_url() {
return site_url('/signin?action=lostpassword');
}
本文标签: filtersHow to changerewrite the lost password url
版权声明:本文标题:filters - How to changerewrite the lost password url? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738745657a2110104.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论