dpspn60064 2019-04-21 07:56
浏览 138

通过ajax或rest api从外部应用程序重置Wordpress密码

I have the same problem like this here: Wordpress REST API - send reset password link

I also tried it with post request to "mydomain/wplogin.php?action=lostpassword" with some parameters. But this didn`t work.

Can somebody explain me, how the wp_lostpassword_url() function works for this problem? It is described in the first answer of the linked post, but I don`t know how to use it.

https://codex.wordpress.org/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( '/lostpassword/?redirect_to=' . $redirect );
}

Can somebody show me some lines of code where and how to use it?

Thanks very much.

Edit:

To make it more clear what I want to achieve. In my Ionic App I want to present a button for the user, which triggers after click a request to my wordpress page. Than the user should get a mail with the password reset link. The request should return a success or fail message. So I can present the user the fail or success message. Is this possible with the filter hook described above, or can I use a rest api route for this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探