I have an MU site, but my homepage it is outside MU. I actually show a login form for logging from the home into MU, but it's a static form. I'd like that users don't see the login form if they are already logged in MU. There is a way to do that? Thanx
I spent a good while trying to find a walkthru on this but nothing came up. Rather surprised about that.
It's my understanding that if you call the file wp-blog-header.php from your site elsewhere, you can have access to the wordpress functions and can then do a check for is_user_logged_in or whatever the check is. Haven't tried this but it's worth a shot.
Take a look at your index.php file found within your mu install's route for how wpmu does this call.
Hoep this helps
cafespain
Member
Posted 15 years ago #
And/Or - Follow through the WordPress MU code to find the bit that checks the cookies and copy that into your static page.
The function is is_user_logged_in(), so search the mu code for "function is_user_logged_in()" and see what it does, if it calls another function search for that. At some point you will either get down to the nitty gritty, or you will find a php file that you can include in your home page and call the functions from it.
That's the way I work out most things, and it gives you a good understanding of the way WordPress functions.
We had a thread a few days ago on this but I can't find it. The code where it actually looks for the cookie is in the pluggable.php file. I *think* that's in the wp-includes subdirectory but I'm not in a position to double check.
Probably would be better to do just the cookie check as running the wp code would require processor power.
Gotta admit that if it came down to it, I'd lean towards loading the blog header file and doing the check. That's like two lines of code vs spending the time digging through the code looking for what you would need to do. I'm a lazy SOB though.
Really would depend on what would work for you. Cafe is right though. It would be a good learning experience.
Reading the code is awesome. All kinds of goodies in there.
The codex page linked to above mentions that it might be outdated. Does anyone have more updated resources on how to load wordpress functions outside of wordpress?