4

Is there a hook-independent way to get the logged in member id inside a hook handler?

Something like a function or a global variable?

1 Answer 1

9

Yip. You're looking for:

ee()->session->userdata('member_id');

It's in the session class:

http://ellislab.com/expressionengine/user-guide/development/usage/session.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.