你需要把用户元的尝试,然后做检查,每次用户点击重置密码。
add_action( \'password_reset\', \'my_password_reset\', 10, 2 );
function my_password_reset( $user, $new_pass ) {
$limit=5;// Set the limit here
$attempts=(int) get_user_meta($user->ID,"reset_attempts",true);
if($attempts>$limit){
//Do something in here, example redirect to warning page.
wp_redirect( "/warning" );
exit;
}
update_user_meta($user->ID,"reset_attempts",$attempts++);
}