Is there a is_user_logged_in() function for WordPress MU / Multisite (3.0+) where I can add in the network site ID like is_user_logged_in(2)
where 2
would be the site_id?
Update:
After a little digging I came up with the code below. Unfortunately it does not work.
//don't use this. does not work. function mu_logged_in($blog_id){ switch_to_blog($blog_id); $status = is_user_logged_in(); restore_current_blog(); return $status; }
anu’s answer and comments are good.
also, make sure you have the cookie domain set correctly in the wp-config.php file 🙂