Skip to:
Content
Pages
Categories
Search
Top
Bottom

Detecting if logged in User is Administrator

  • @jordashtalon

    Member

    How would you detect if the logged in user is the administrator of the website, I want to output debugging information, but only to the administrator for obvious reasons.

Viewing 6 replies - 1 through 6 (of 6 total)
  • @rogercoathup

    Participant

    you could try the function:

    is_site_admin()

    It’s used extensively throughout the BuddyPress core files

    @rogercoathup

    Participant

    interestingly, it has been deprecated in WP3.0 and replaced with is_super_admin:

    https://codex.wordpress.org/WPMU_Functions/is_site_admin

    It’s still used in numerous places in the BuddyPress plugin though

    @johnjamesjacoby

    Keymaster

    It will get a sweep through for 1.2.6. :)

    @rogercoathup

    Participant

    @johnjamesjacoby – I suspected you might have that one covered :-)

    @drwebstein

    Member

    Is it possible this could be causing my newly added users to get a blank white screen when they click the link within the auto-generated email once I’ve created the new user?

    In testing, I find that if I’m still logged in to the admin back-end when I click the login link within an auto-generated new user email, I get the dreaded blank white screen. However, if I log out of the back-end before clicking the exact same link within the email, then the login screen comes up just fine.

    Has anybody else seen this behavior? If so, have you tried replacing all instances of is_site_admin with is_super_admin and did that change this behavior?

    Thanks,
    Adam

    @drwebstein

    Member

    I decided to go ahead and try replacing all references to is_site_admin with is_super_admin, but it did not resolve this issue.

    If anybody else is experiencing this issue, we can continue to discuss in the new thread that I set up for it at https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/blank-white-screen-when-a-newly-created-user-clicks-the-login-link-if-somebody-is-already-logged-into-the-admin-back-end/

    Thanks,
    Adam

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Detecting if logged in User is Administrator’ is closed to new replies.
Skip to toolbar