admin管理员组文章数量:1026630
With a plugin how would you change the URL returned by wp_lostpassword_url()?
The function wp_lostpassword_url() returns the URL where users can reset their password.
Function Reference/wp lostpassword url
With a plugin how would you change the URL returned by wp_lostpassword_url()?
The function wp_lostpassword_url() returns the URL where users can reset their password.
Function Reference/wp lostpassword url
Share Improve this question asked Nov 9, 2015 at 14:31 Peter BushnellPeter Bushnell 1751 gold badge2 silver badges12 bronze badges 1- I also recomend this article, it helped me a lot code.tutsplus/tutorials/… – Gendrith Commented Mar 28, 2019 at 9:16
1 Answer
Reset to default 6Just check the source:
515 /**
516 * Filter the Lost Password URL.
517 *
518 * @since 2.8.0
519 *
520 * @param string $lostpassword_url The lost password page URL.
521 * @param string $redirect The path to redirect to on login.
522 */
523 return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
There is a lostpassword_url
filter that should do exactly what you are asking.
function passurl_wpse_208054($lostpassword_url, $redirect ) {
return 'http://path/to/login/url';
}
add_filter('lostpassword_url', 'passurl_wpse_208054', 10, 2);
With a plugin how would you change the URL returned by wp_lostpassword_url()?
The function wp_lostpassword_url() returns the URL where users can reset their password.
Function Reference/wp lostpassword url
With a plugin how would you change the URL returned by wp_lostpassword_url()?
The function wp_lostpassword_url() returns the URL where users can reset their password.
Function Reference/wp lostpassword url
Share Improve this question asked Nov 9, 2015 at 14:31 Peter BushnellPeter Bushnell 1751 gold badge2 silver badges12 bronze badges 1- I also recomend this article, it helped me a lot code.tutsplus/tutorials/… – Gendrith Commented Mar 28, 2019 at 9:16
1 Answer
Reset to default 6Just check the source:
515 /**
516 * Filter the Lost Password URL.
517 *
518 * @since 2.8.0
519 *
520 * @param string $lostpassword_url The lost password page URL.
521 * @param string $redirect The path to redirect to on login.
522 */
523 return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
There is a lostpassword_url
filter that should do exactly what you are asking.
function passurl_wpse_208054($lostpassword_url, $redirect ) {
return 'http://path/to/login/url';
}
add_filter('lostpassword_url', 'passurl_wpse_208054', 10, 2);
本文标签: Change reset password URL returned by wplostpasswordurl() via plugin
版权声明:本文标题:Change reset password URL returned by wp_lostpassword_url() via plugin 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745650882a2161311.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论