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.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/pluggable.php

	function is_user_logged_in() {
		$user = wp_get_current_user();

		return $user->exists();
	}


Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More