📜  从 wordpress 中更改密码注销 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.939000             🧑  作者: Mango

代码示例1
// Get current logged-in user.
$user = wp_get_current_user();

// Change password.
wp_set_password($new_password, $user->ID);

// Log-in again.
wp_set_auth_cookie($user->ID);
wp_set_current_user($user->ID);
do_action('wp_login', $user->user_login, $user);