0
我創建了一個簡單的登錄/註冊頁面,包含用戶審覈和自舉wp的繁重工作。wp_generate_password返回密碼,但無法使用它登錄
我可以得到新的用戶添加到數據庫和密碼獲取創建和哈希和所有,但是當我去登錄w /該帳戶的密碼將無法正常工作。我難倒...
然而,當我去到管理下我的管理員帳戶和更改用戶的密碼就可以讓我登錄就好了......
任何人都看不到任何東西我是失蹤?
require_once(ABSPATH . WPINC . '/registration.php');
$user_pass = wp_generate_password();
$userdata = array(
'user_pass' => $user_pass,
'user_login' => esc_attr($_POST['user_email']),
'user_email' => esc_attr($_POST['user_email']),
);
if(!$userdata['user_login'])
$error .= __('An Email Address is required for registration.', 'frontendprofile');
elseif (username_exists($userdata['user_login']))
$error .= __('Sorry, that Email Address is already in use for another account.', 'frontendprofile');
elseif (!is_email($userdata['user_email']))
$error .= __('You must enter a valid Email Address.', 'frontendprofile');
elseif (email_exists($userdata['user_email']))
$error .= __('Sorry, that Email Address is already for another account.', 'frontendprofile');
else{
$new_user = wp_update_user($userdata);
}