简体   繁体   English

WordPress的do_action password_reset不起作用

[英]Wordpress do_action password_reset is not working

i am using wordpress 4.7.3. 我正在使用wordpress 4.7.3。 Password reset is not working. 密码重置不起作用。 When i debugged my code. 当我调试我的代码时。 I reached to this line inside users.php reset_password(): 我到达users.php reset_password()的这一行:

do_action( 'password_reset', $user, $new_pass );

Soon after there is a line : 在一行之后不久:

wp_set_password( $new_pass, $user->ID );

Because do_action is not working, its not going inside the wp_set_password function. 因为do_action不起作用,所以它不在wp_set_password函数内部。 I don't why default wordpress reset password is not working. 我不为什么默认的wordpress重置密码不起作用。 Stucked from last 2 days. 从最近2天开始停留。 Expert suggestion please? 请专家建议?

if(!is_user_logged_in())   
  {
     $new_pass='password';
     $user='1';
     wp_set_password( $new_pass, $user);  
  }

please try this 请尝试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM