• XEN DEVELOPMENT is a developer's resource for new developers wanting to build XenForo 2 add-ons. Experienced developers are also welcome to share their experienes and knowledge. This site is not affiliated with XenForo or a replacement for the official XenForo developer forums.
Getting $user Information

Getting $user Information

In XenForo 1, getting the user_id involved the getInstance and getUserId methods.

PHP:
$user_id =XenForo_Visitor::getInstance()->getUserId();
In XenForo 2, it's a matter of using visitor().

PHP:
$visitor = \XF::visitor();

$user_id =...
You do not have permission to view the full content of this resource. Log in or register now.
Author
LPH
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LPH

Top