• Hi,
    I am creating a multisite network. I am using this peace of code: wp_redirect($current_url = home_url(add_query_arg(array(),$wp->request)) );
    and it is working great. My only problem is, I want people to be redirected to their home-url/wp-admin. How do I specifie that I do not only want people to be redirected to their home url, but also wp-admin?
    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Use get_blogs_of_user() to get an array of the user’s blogs. I’m not sure how you would decide which blog to use if there are more than one. You could arbitrarily take the first in the list, or maybe the one with the lowest ID, which is probably the same thing anyway. Each blog item listed is a stdClass object of blog data. Get the “siteurl” property and concatenate “/wp-admin/” to it.

    Thread Starter benjaminsaarde

    (@benjaminsaarde)

    Thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp-redirect’ is closed to new replies.