Users and Authors (category)

Roles and Capabilities

add_role()

Add a new role to WordPress.

author_can()

Checks whether the author of the supplied post has a specific capability.

current_user_can()

Whether the current user has a specific capability.

get_role()

Retrieve an object with the capabilities of the specified role.

is_super_admin()

Determine if user is a site admin.

map_meta_cap()

Map meta capabilities to primitive capabilities.

remove_role()

Removes a role from WordPress.

user_can()

Checks whether a specified user has a specified capability.

wp_roles()

Retrieves the global WP_Roles instance and instantiates it if necessary.

WP_Roles::add_cap()

Add capability to role.

WP_User::add_cap()

Add capability and grant or deny access to capability.

Metadata (usermeta)

add_user_meta()

Adds meta data to a user.

delete_user_meta()

Remove metadata matching criteria from a user.

get_the_author_meta()

Retrieves the requested data of the current or requested user (post author).

get_user_meta()

Gets an single meta field or all meta fields of the specified user.

the_author_meta()

Outputs the field from the user's DB object. Defaults to current post's author.

update_user_meta()

Update user meta field based on user ID.

Other

auth_redirect()

Checks if a user is logged in, if not it redirects them to the login page.

count_many_users_posts()

Number of posts written by a list of users.

count_user_posts()

Gets the number of posts of a specified type for a specified user (author).

count_users()

Count number of users who have each of the user roles.

email_exists()

Checks whether the given email exists.

get_author_posts_url()

Retrieve the URL to the author page for the user with the ID provided.

get_current_user_id()

Get the current user's ID.

get_currentuserinfo()

Populate global variables with information about the currently logged in user.

get_edit_user_link()

Retrieves the edit user link.

get_editable_roles()

Fetch a filtered list of user roles that the current user is allowed to edit.

get_the_author()

Retrieve the author of the current post.

get_the_author_link()

Retrieve either author's link or author's name.

get_the_author_posts_link()

Retrieves an HTML link to the author page of the current post's author.

get_the_modified_author()

Retrieve the author who last edited the current post.

get_user_by()

Gets the user by the specified field and the value of this field (by ID, login, mail).

get_userdata()

Retrieve user data by user ID as WP_User object.

get_users()

Gets users according to the passed parameters.

is_multi_author()

Does this site have more than one author

sanitize_user()

Sanitizes a username, stripping out unsafe characters.

the_author_link()

Display either author's link or author's name.

the_author_posts()

Display the number of posts by the author of the current post.

the_author_posts_link()

Displays HTML link (<a> tag) to the archive page of the author of the current post. The text of the link will be the name of the author.

the_modified_author()

Display the name of the author who last edited the current post, if the author's ID is available.

username_exists()

Checks whether the given username (login) exists.

validate_username()

Checks whether a username (login) is valid.

wp_dropdown_roles()

Print out <option> html elements for all user roles, for <select> element.

wp_dropdown_users()

Create dropdown HTML content of users.

wp_get_current_user()

Retrieve the current authorized user data (WP_User object). Sets current user, if not set yet.

wp_list_authors()

List all the authors of the site, with several options available.

wp_list_users()

List all the users of the site, with several options available.

wp_set_current_user()

Changes the current user by ID or name. The function does not authorize the user but changes the global variable $current_user and its associated variables.

Login/Logout

check_password_reset_key()

Retrieves a user row based on password reset key and login

get_password_reset_key()

Creates, stores, then returns a password reset key for user.

is_login()

Determines whether the current request is for the login screen.

is_user_logged_in()

Checks if the current visitor is a logged in user.

wp_authenticate()

Checks the authorization data of the registered user (login and password) and authorizes it if the check was passed.

wp_check_password()

Checks the plaintext password against the encrypted Password.

wp_get_password_hint()

Gets the text suggesting how to create strong passwords.

wp_login_form()

Provides a simple login form for use anywhere within WordPress.

wp_login_url()

Retrieves the login URL.

wp_loginout()

Display the Log In/Out link.

wp_logout()

Log the current user out.

wp_logout_url()

Retrieves the logout URL. Returns the URL that allows the authorized user to log out of the site.

wp_lostpassword_url()

Returns the URL that allows the user to retrieve the lost password

wp_register()

Displays either the link to the dashboard ("Site Admin") if the user is logged in or "Register" link if the user is not logged in.

wp_registration_url()

Returns the URL that allows the user to register on the site.

wp_set_auth_cookie()

Authorizes (Log in) a user by ID. Sets authentication cookies based on the transmitted user ID.

wp_set_password()

Updates the user's password with a new encrypted one. Updates the specified password in the database and resets the user's cache.

wp_signon()

Authenticates and logs a user in with 'remember' capability.

User insertion/removal

register_new_user()

Handles registering a new user.

wp_create_user()

A simpler way of inserting a user into the database.

wp_delete_user()

Remove user and optionally reassign posts and links to another user.

wp_insert_user()

Creates a WordPress user in the Database.

wp_new_user_notification()

Notifies by email the site administrator about new user registration, and sends the user an email with a login and password.

wp_update_user()

Update a user data in the database. Work with both tables wp_usermeta and wp_users.