Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] Profile tabs – show_for_displayed_user & is_site_admin() ?

@danbp

Participant

@bigkahunaburger,

Allow admin: current_user_can( 'manage_options' )

Allow the profile owner: bp_loggedin_user_id() == bp_displayed_user_id()

You might use it like this:

if ( current_user_can( 'manage_options' ) || bp_loggedin_user_id() == bp_displayed_user_id() ) {
   //do something
}

It is also best practice to check that the component is active to avoid errors on update or when BP is deactivated. In this case, xprofile.

if ( bp_is_active( 'xprofile' ) )

Skip to toolbar