Resource icon

XF 2 Tip Get user_id of visitor

Compatible XF Versions
2.x
In XenForo 1, getting the user_id involved the getInstance and getUserId methods.
Code:
$user_id =XenForo_Visitor::getInstance()->getUserId();
In XenForo 2, it's a matter of using visitor().
Code:
$visitor = \XF::visitor();

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

More resources from ENXF NET

Top

AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock