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() | Determines whether the user is a super administrator (for multisites). |
| map_meta_cap() | Translates the given meta-capability into a primitive capability so that the user's access can then be checked. |
| remove_role() | Removes a role from WordPress. |
| user_can() | Checks whether a specified user has a specified capability. |
| wp_roles() | Retrieves the global variable $wp_roles; if it is not defined, writes an instance of the WP_Roles class into it. |
| WP_Roles::add_cap() | Adds or removes a capability for the specified role. |
| WP_User::add_cap() | Adds or removes the right (ability) for the specified user. |
Metadata (usermeta)
| add_user_meta() | Adds metadata to the specified user. |
| delete_user_meta() | Deletes the specified meta-data of a certain 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 specified meta-field of the current or specified user. The meta-data is specified in the profile. |
| update_user_meta() | Updates the meta-field of the specified user. |
Other
| auth_redirect() | Checks if the user is authorized before allowing them on any page of the site. |
| count_many_users_posts() | Returns the number of posts for multiple specified users (IDs are provided). |
| count_user_posts() | Gets the number of posts of a specified type for a specified user (author). |
| count_users() | Counts the total number of users, dividing them by roles (administrators, subscribers). |
| email_exists() | Checks if the specified email exists among registered users. |
| get_author_posts_url() | Gets the URL (link) to the author's archive page (the page with the user's posts). |
| get_current_user_id() | Get the current user's ID. |
| get_currentuserinfo() | Sets the global variable $current_user, which contains the data of the currently logged-in user. |
| get_edit_user_link() | Gets the URL of the user's profile page in the admin panel. |
| get_editable_roles() | Returns a filtered list of user roles. |
| get_the_author() | Gets the name (display_name) of the post author. Used inside the WordPress loop. |
| get_the_author_link() | Returns a link (A tag) to the author's website. The anchor of the link will be the author's name. |
| get_the_author_posts_link() | Gets the HTML code for a link to the author's post archive page. The link text will be the "displayed" name of the author. This template tag should be used inside the WordPress Loop. |
| get_the_modified_author() | Gets the name (display_name) of the user (author) who last edited the current post. |
| get_user() | Gets a user object based on its numeric ID. |
| 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() | Defines whether there is more than one author on the site who has published posts. Conditional tag. |
| sanitize_user() | Cleans the username (login, username) by removing unsafe characters. |
| the_author_link() | Outputs the HTML code for a link to the author's site. |
| the_author_posts() | Outputs the total number of posts (int) written by the current author. Used inside the WordPress Loop. |
| the_author_posts_link() | Displays HTML link ( |
| the_modified_author() | Outputs the author who last edited the post. |
| username_exists() | Checks whether the given username (login) exists. |
| validate_username() | Checks the correctness of the username (username - login). |
| wp_dropdown_roles() | Print out <option> html elements for all user roles, for |
| wp_dropdown_users() | Displays a dropdown list 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() | Outputs a list of blog authors as links to their posts if posts exist. |
| wp_list_users() | Outputs/gets a list of users' display names from the site in a simple or LI list format. A number of parameters can be specified for selection. |
| wp_send_new_user_notifications() | Notifies the site administrator by email about the registration of a new user, and also sends the user an email with their login and password for authentication. |
| 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() | Checks (compares) the provided key for password recovery with the hash of that key in the database. |
| get_password_reset_key() | Creates a key in the database for password recovery for the specified user and returns this key. |
| is_login() | Checks if the user is on the WordPress admin login page. |
| is_user_logged_in() | Checks if the user is authorized (if the user has logged in with their username). Returns true if the user is authorized and false if not. Conditional tag. |
| reset_password() | Resets (changes) the password of the specified 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_destroy_other_sessions() | Deletes all active sessions except the current one from the database for the current user. |
| wp_get_password_hint() | Gets text with an explanation of how to create a strong password. |
| wp_get_session_token() | Gets the current session token of the current user from the cookie |
| wp_login_form() | Outputs the HTML code for the login form. |
| wp_login_url() | Gets the login/authentication page URL: /wp-login.php |
| wp_loginout() | Outputs a "login" link if the user is not authenticated and a "logout" link if authenticated. |
| wp_logout() | Logs out. De-authenticates the user: destroys the current session and clears the authorization cookies. |
| wp_logout_url() | Retrieves the logout URL. Returns the URL that allows the authorized user to log out of the site. |
| wp_lostpassword_url() | Gets the URL (link) to the password recovery page. Commonly used in the template (template tag). |
| 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() | Gets the URL for the registration page: wp-login.php?action=register. |
| 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() | Authorizes the user by the specified login/email, password, and remember parameter. |
User insertion/removal
| register_new_user() | Registers a new user. Only the login and email are specified. |
| wp_create_user() | A simpler way of inserting a user into the database. |
| wp_delete_user() | Deletes a user. If desired, transfers 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. |