Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do you make a BuddyPress menu item only visible to admin


  • JWachsman
    Participant

    @jwachsman

    I’ve been tasked to make a BuddyPress menu item only visible to admin’s when logged in. While I thought this would be straightforward, I’m new to BuddyPress so I’m not exactly sure how this is done. Any guidance/direction would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)

  • shanebp
    Moderator

    @shanebp

    Which menu item?


    JWachsman
    Participant

    @jwachsman

    It’s actually a custom menu item that was created. It’s a questionnaire (Winner’s Questionnaire is the name of the page) that should only be visible to admin’s when logged in. So it’s not a built in menu item. I didn’t write the original code and as mentioned above I’m new to BuddyPress so this is pretty foreign to me.

    I’m not sure that really helps but hopefully it’s enough to give me a general answer to point me in the right direction.


    shanebp
    Moderator

    @shanebp

    The WP function to determine if the current user is an administrator is:
    is_super_admin()

    So something like:

    if ( is_super_admin() ) 
       // show the menu item
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar