Skip to:
Content
Pages
Categories
Search
Top
Bottom

How To Limit “Profile” Tab Visibility Only To Account Owner & Admins


  • densyo
    Participant

    @densyo

    Hi there,

    Wordpress Version 4.5.3
    Buddypress Version 2.6.2
    Site: http://freshink.ph

    Is there a way to make the “Profile” tab only visible to account owners and admins?

    Thanks!
    Dennis

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

  • danbp
    Participant

    @danbp

    Hi @densyo,

    – first, you check that xprofile component is active: if( bp_is_active( 'xprofile' ) )
    – then check you’re on a user page: bp_is_user()
    – allow site admin: is_super_admin()
    – check if the current page part of the profile belongs to logged-in user: bp_is_my_profile()

    Example here:
    https://buddypress.org/support/topic/the-right-way-to-remove-nav-items/


    densyo
    Participant

    @densyo

    Hi @danbp,

    Thanks for your reply, really appreciate it! Sorry, but I am not a developer, on what file do I add the code snippet from the example? Is it one of the files in the buddypress/bp-xprofile folder?

    Thanks!
    Dennis


    danbp
    Participant

    @danbp

    Never modify original files.
    Custom code for BP can be added to bp-custom.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar