最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Change reset password URL returned by wp_lostpassword_url() via plugin

matteradmin6PV0评论

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
Add a comment  | 

1 Answer 1

Reset to default 6

Just 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);
Post a comment

comment list (0)

  1. No comments so far