The MU forums have moved to WordPress.org

Redirect user to blog after login (3 posts)

  1. RobinRI
    Member
    Posted 16 years ago #

    I have a WPMU installed using directory mode into the domain root (e.g. mydomain.com). I with titles numbered "1" to "8" so the urls are:

    http://mydomain.com/1/
    http://mydomain.com/2/
    http://mydomain.com/3/

    When a user (say "joe") logs in at mydomain.com/wp-login.php I want to find out what what blog he/she is a contributor to (all users are contributors) and redirect to the home page for that blog (e.g. http://mydomain.com/3/). Any quick way to do this? Any PHP functions that can tell me what blog(s) a user belongs to?

    I've looked at the php docs, the best thing I can think of right now is to add the blog the belong to as their URL and use "get_usermeta" and redirect based on that, of course it will break if the edit this in their profile.

  2. RobinRI
    Member
    Posted 16 years ago #

    Sorry to reply to my own question, looks like get_blogs_of_user() is a good way to do this. If anyone has further suggestions please post them.

  3. Peavy
    Member
    Posted 15 years ago #

    Hi,

    I'd like to do the opposite. In fact, I'm using WPu 2.6 and I host several blogs.

    I'd like people to be redirected to the wp-admin of the blog they connect from, rather than being redirected to th blog they subscribe.

    Is it possible ? I think it deals with the wp-admin/includes/mu.php and the function redirect_user_to_blog but have no clue of what has to be changed...

    I'm going back to the code... hoping I'll find a solution

    Peavy 8)

About this Topic