我的登录过程如下所示:
1- user put email in the form
2- a link sent to email for setting password
3- user click on the link and redirect to website with code like this:
https://www.example.com/my-account/?action=rp&key=oH02AnKdf3xGAU9TvAVew&login=email@example.com
现在在这个新表单中,我试图捕获密码并将其放入元数据表中;但是
I can;t detect which user ID is logged in 访问网站。
在更改注册流程之前,我的注册代码是:
add_action( \'user_register\', \'myplugin_registration_save\', 10, 1 );
function myplugin_registration_save( $user_id ) {
update_user_meta($user_id, \'user_pass2\', (string) $_POST[\'pass2\']);
}
为了更新密码,我使用了这个钩子:
add_action( \'profile_update\', \'my_profile_update\' );
但它们都是在用户实际登录并发布一些数据时使用的。