W3cubDocs

/WordPress

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();
	}

Changelog

Version Description
2.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_user_logged_in