Checks if the current visitor is a logged in user.

Signature

is_user_logged_in()

Return

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

Source

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

	return $user->exists();
}
WP Trac GitHub

Link here