I’m tinkering with writing a plugin and when I run it on a single blog WordPress site, the wp_login action hook works great. In my function I can get the user name of the logged in user in my function with global $user_name;. However when I try the same code on a WordPress multi user/network install, I get nothing for the user name. Not even for the admin. Not being sure if it was the wp_login hook or my function that it should call, I also tried getting the username via global $current_user; get_currentuserinfo(); and then using $current_user->user_login but that still gives me nothing. What’s adding to my confusion is that I also tested using wp_logout in multi user/network mode and global $current_user; get_currentuserinfo(); with $current_user->user_login works.
So is this a mu/network bug with the wp_login action hook, or am I missing something?
- The topic ‘Wp_login Action Hook Doesn't Work in Network Mode?’ is closed to new replies.