is_user_logged_in

Checks if the current visitor is a logged in user.

Description

is_user_logged_in(); 

Usage

  1. if ( !function_exists( 'is_user_logged_in' ) ) { 
  2. require_once ABSPATH . WPINC . '/pluggable.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = is_user_logged_in(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/pluggable.php  
  1. function is_user_logged_in() { 
  2. $user = wp_get_current_user(); 
  3.  
  4. return $user->exists();