wp_create_user
函数
wp_create_user ( $username, $password, $email = '' )
- 参数
-
-
(string)
$username
The user’s username.- Required: 是
-
(string)
$password
The user’s password.- Required: 是
-
(string)
$email
Optional. The user’s email. Default empty.- Required: 否
- Default: (empty)
-
(string)
- 返回值
-
- (int|WP_Error) The newly created user’s ID or a WP_Error object if the user could not be created.
- 相关
-
- wp_insert_user()
- 定义位置
-
-
wp-includes/user.php
, line 2741
-
wp-includes/user.php
- 引入
- 2.0.0
- 弃用
- –
Provides a simpler way of inserting a user into the database.
Creates a new user with just the username, password, and email. For more
complex user creation use wp_insert_user() to specify more information.
function wp_create_user( $username, $password, $email = '' ) { $user_login = wp_slash( $username ); $user_email = wp_slash( $email ); $user_pass = $password; $userdata = compact( 'user_login', 'user_email', 'user_pass' ); return wp_insert_user( $userdata ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。