is_user_logged_in() – Determines whether the current visitor is a logged in user.

You appear to be a bot. Output may be restricted

Description

Determines whether the current visitor is a logged in user.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Usage

$bool = is_user_logged_in();

Parameters

Returns

bool True if user is logged in, false if not logged in.

Source

File name: wordpress/wp-includes/pluggable.php
Lines:

1 to 5 of 5
  function is_user_logged_in() {
    $user = wp_get_current_user();

    return $user->exists();
  }
 

 View on GitHub View on Trac