[resolved] get the admin username of a multisite blog (5 posts)

  1. stevenss
    Posted 3 years ago #


    I use the function get_userdata (username) to get a variable file.
    So eg the user (=admin and only user of a multisite blog) "test" would see the content of the file:
    ....com/folder/'.$username.'.txt = ....com/folder/test.txt

    This works, though this is for a multisite and I would like the superadmin to see the same content...but of course the admin won't see the same since wordpress then pulls the content of the file ....com/folder/superadmin.txt, which doesn't exist.

    So I would like a function that doesn't get the username of the logged in user, but the username of the admin of the current blog, so the username sees the same content as the admin of the blog.

    Is there such a function? If so, it would be great if you could show it.

    Thanks in advance

  2. andrewmills
    Posted 3 years ago #

    Hi, Steven. I'm not completely certain if this is what you are looking for, but have you tried get_admin_users_for_domain?

    Based on what I'm reading, it may be possible for multiple names to be returned if a particular site has more than one admin level user.

  3. stevenss
    Posted 3 years ago #

    That will work.


  4. andrewmills
    Posted 3 years ago #

    You're welcome. When you consider this matter resolved, could I ask you to change the status of this thread to resolved? Thank you.

  5. stevenss
    Posted 3 years ago #

    Ok ;)

Topic Closed

This topic has been closed to new replies.

About this Topic