is_user_logged_in() WordPress Function
The is_user_logged_in() function is used to check whether the current user is logged in or not. If the user is logged in, it returns true; otherwise, it returns false.
is_user_logged_in() #
Determines whether the current visitor is a logged in user.
Description
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Return
(bool) True if user is logged in, false if not logged in.
Source
File: wp-includes/pluggable.php
function is_user_logged_in() { $user = wp_get_current_user(); return $user->exists(); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Related
Uses
Uses | Description |
---|---|
wp-includes/pluggable.php:wp_get_current_user() | Retrieve the current user object. |
Used By
Used By | Description |
---|---|
wp-includes/blocks.php:build_comment_query_vars_from_block() | Helper function that constructs a comment query vars array from the passed block properties. |
wp-includes/block-template.php:locate_block_template() | Find a block template with equal or higher specificity than a given PHP template file. |
wp-includes/block-template.php:get_the_block_template_html() | Returns the markup for the current template. |
wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php:WP_REST_Application_Passwords_Controller::get_user() | Gets the requested user. |
wp-includes/class-wp-recovery-mode.php:WP_Recovery_Mode::handle_exit_recovery_mode() | Handles a request to exit Recovery Mode. |
wp-admin/includes/class-wp-site-health.php:WP_Site_Health::check_wp_version_check_exists() | Test if |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::handle_dismiss_autosave_or_lock_request() | Deletes a given auto-draft changeset or the autosave revision for a given changeset or delete changeset lock. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::handle_changeset_trash_request() | Handles request to trash a changeset. |
wp-includes/general-template.php:wp_enqueue_code_editor() | Enqueue assets needed by the code editor for the given settings. |
wp-includes/rest-api.php:rest_authorization_required_code() | Returns a contextual HTTP error code for authorization failure. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::changeset_data() | Gets changeset data. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:WP_REST_Comments_Controller::create_item_permissions_check() | Checks if a given request has access to create a comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:WP_REST_Comments_Controller::create_item() | Creates a comment. |
wp-includes/comment.php:wp_check_comment_flood() | Checks whether comment flooding is occurring. |
wp-includes/rest-api.php:rest_send_cors_headers() | Sends Cross-Origin Resource Sharing headers with API requests. |
wp-includes/rest-api.php:rest_cookie_check_errors() | Checks for errors when using cookie-based authentication. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::customize_pane_settings() | Prints JavaScript settings for parent window. |
wp-includes/rest-api/class-wp-rest-server.php:WP_REST_Server::serve_request() | Handles serving a REST API request. |
wp-includes/user.php:retrieve_password() | Handles sending a password retrieval email to a user. |
wp-signup.php:validate_another_blog_signup() | Validates a new site sign-up for an existing user. |
wp-signup.php:show_blog_form() | Generates and displays the Sign-up and Create Site forms. |
wp-signup.php:validate_blog_form() | Validates the new site sign-up. |
wp-admin/includes/ms.php:_access_denied_splash() | Displays an access denied message when a user tries to view a site’s dashboard they do not have access to. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::save() | Handles customize_save WP Ajax request to save/update a changeset. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::setup_theme() | Starts preview and customize theme. |
wp-includes/general-template.php:wp_heartbeat_settings() | Default settings for heartbeat |
wp-includes/general-template.php:user_can_richedit() | Whether the user can access the visual editor. |
wp-includes/general-template.php:wp_loginout() | Display the Log In/Out link. |
wp-includes/general-template.php:wp_register() | Display the Registration or Admin link. |
wp-includes/class-wp.php:WP::send_headers() | Sends additional HTTP headers for caching, content type, etc. |
wp-includes/class-wp-query.php:WP_Query::get_posts() | Retrieves an array of posts based on query variables. |
wp-includes/class-wp-query.php:WP_Query::parse_search() | Generates SQL for the WHERE clause based on passed search terms. |
wp-includes/functions.php:wp_auth_check() | Check whether a user is still logged in, for the heartbeat. |
wp-includes/functions.php:wp_auth_check_load() | Load the auth check for monitoring whether the user is still logged in. |
wp-includes/link-template.php:get_adjacent_post() | Retrieves the adjacent post. |
wp-includes/class-wp-admin-bar.php:WP_Admin_Bar::_render() | |
wp-includes/class-wp-admin-bar.php:WP_Admin_Bar::initialize() | Initializes the admin bar. |
wp-includes/admin-bar.php:wp_admin_bar_site_menu() | Adds the “Site Name” menu. |
wp-includes/admin-bar.php:wp_admin_bar_my_sites_menu() | Adds the “My Sites/[Site Name]” menu and all submenus. |
wp-includes/admin-bar.php:is_admin_bar_showing() | Determines whether the admin bar should be showing. |
wp-includes/post-template.php:get_body_class() | Retrieves an array of the class names for the body element. |
wp-includes/post.php:get_posts_by_author_sql() | Retrieve the post SQL based on capability, author, and type. |
wp-includes/post.php:_count_posts_cache_key() | Return the cache key for wp_count_posts() based on the passed arguments. |
wp-includes/post.php:wp_count_posts() | Count number of posts of a post type and if user has permissions to view. |
wp-includes/comment-template.php:get_post_reply_link() | Retrieves HTML content for reply to post link. |
wp-includes/comment-template.php:wp_list_comments() | Displays a list of comments. |
wp-includes/comment-template.php:comment_form() | Outputs a complete commenting form for use within a template. |
wp-includes/comment-template.php:comments_template() | Loads the comment template specified in $file. |
wp-includes/comment-template.php:get_comment_reply_link() | Retrieves HTML content for reply to comment link. |
wp-includes/class-wp-customize-widgets.php:WP_Customize_Widgets::wp_ajax_update_widget() | Updates widget settings asynchronously. |
wp-includes/comment.php:get_page_of_comment() | Calculates what page number a comment will appear on for comment paging. |
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |