wp_set_password()修改某个指定用户的密码

目录

描述

Updates the user's password with a new encrypted one.

For integration with other applications, this function can be overwritten to
instead use the other package password checking algorithm.

wp_set_password() 描述

用法

<?php wp_set_password$password$user_id ?>

wp_set_password() 用法

参数

$password

(string) (必填) The plaintext new user password

默认值: None

$user_id

(integer) (必填) User ID

默认值: None

wp_set_password() 参数

示例

Below is an example showing how to update a user's password

Please note: This code should be deleted after ONE page load, otherwise the password will be reset on every subsequent load, sending the user back to the login screen each time.

wp_set_password() 示例

注意

wp_set_password() 注意

历史

添加于 版本: 2.5

wp_set_password() 历史

源文件

wp_set_password() 函数的代码位于 wp-includes/pluggable.php

wp_set_password() 源文件

相关