Glossary Term
wp_insert_user()
wp_insert_user() — Inserts a user into the database. Most of the $userdata array fields have filters associated with the values. Exceptions are ‘ID’, ‘rich_editing’, ‘syntax_highlighting’, ‘comment_shortcuts’, ‘admin_color’, ‘use_ssl’, ‘user_registered’, ‘user_activation_key’, ‘spam’, and ‘role’. The filters have the prefix ‘pre_user_’ followed by the field name. An example using ‘description’ would have the filter called ‘pre_user_description’ that can be hooked into.
Inputs: $userdata (array|object|WP_User): An array, object, or WP_User object of user data arguments. Field $ID (int): User ID. If supplied, the user will be updated. Field $user_pass (string): The plain-text user password for new users. Hashed password for existing users. Field $user_login (string): The user’s login username. Field $user_nicename (string): The URL-friendly user name. Field $user_url (string): The user URL. Field $user_email (string): The user email address. Field $display_name (string): The user’s display name. Default is the user’s username. Field $nickname (string): The user’s nickname. Default is the user’s username. Field $first_name (string): The user’s first name.
Returns int|WP_Error: The newly created user’s ID or a WP_Error object if the user could not be created.
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
