The MU forums have moved to WordPress.org

Pull User Info based on Blog ID (2 posts)

  1. MrBrian
    Member
    Posted 14 years ago #

    I don't know why i'm having such a hard time finding a way of pulling the user_login based on the current blog ID, but i've searched and searched through the codex, functions/wpmu-functions and nothing really does this what seems to be very basic task. The blog_id is global, but all i really need to do is get the user_login name for the currently displayed blog, for use in a plugin. Help very much appreciated so i don't spend another 2 hours on this!

  2. theapparatus
    Member
    Posted 14 years ago #

    Take a look at the function get_current_user. It's used a number of places within the script. I think the admin bar plugins on wpmudev.org uses it as well. I know it displays the username of the current user. Can't remember how exactly how it does it though but I know it's in there.

About this Topic

  • Started 14 years ago by MrBrian
  • Latest reply from theapparatus