wp_create_user()创建一个新用户

目录

描述

译文

通过对三个参数进行解析,该函数可以在WordPress数据库中创建新用户。函数用$wpdb类避开变量值,以准备插入数据库。最后PHP compact() function用这些值创建一个数组。

原文

The wp_create_user function allows you to insert a new user into the WordPress database. It uses the $wpdb class to escape the variable values, preparing it for insertion into the database. Then the PHP compact() function is used to create an array with these values. To create a user with additional parameters, use wp_insert_user().

wp_create_user() 描述

用法

 <?php wp_create_user$username$password$email ); ?> 

wp_create_user() 用法

参数

$username

(string) (必填) The username of the user to be created.

默认值: None

$password

(string) (必填) The password of the user to be created.

默认值: None

$email

(string) (可选) The email address of the user to be created.

默认值: None

wp_create_user() 参数