0
我的用户从另一个系统来到我的wordpress网站。这个系统发送$ _SESSION到我的WordPress。禁用Wordpress密码散列
我有功能如何自动登录。但问题是,我可以从我的数据库只采取哈希密码。我需要禁用密码哈希和我的功能将工作。
function wpdocs_custom_login() {
if(isset($_SESSION['usr_email'])){
$user = get_user_by('login', $_SESSION['usr_login']);
$creds = array(
'user_login' => $user->user_login,
'user_password' => $user->user_pass,
'remember' => true
);
$user = wp_signon($creds, false);
if (is_wp_error($user)) {
echo $user->get_error_message();
}
}
}
// Run before the headers and cookies are sent.
add_action('after_setup_theme', 'wpdocs_custom_login');
?>
你能帮帮我吗?