Uses
Uses | Description |
---|---|
wp-includes/formatting.php: wp_slash() | Add slashes to a string or array of strings, in a recursive manner. |
wp-includes/user.php: wp_insert_user() | Insert a user into the database. |
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.
(string) (Required) The user's username.
(string) (Required) The user's password.
(string) (Optional) The user's email.
Default value: ''
(int|WP_Error) The newly created user's ID or a WP_Error object if the user could not be created.
File: wp-includes/user.php
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 ); }
Version | Description |
---|---|
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_create_user