my code below works like a charm for logged in users to hide certain tabs:
function bpfr_hide_activity_nav() {
if( !current_user_can( 'subscriber' ) ){
return;
}
bp_core_remove_nav_item( 'media' );
bp_core_remove_nav_item( 'forums' );
bp_core_remove_nav_item( 'orders' );
bp_core_remove_nav_item( 'activity' );
}
add_action( 'bp_ready', 'bpfr_hide_activity_nav' );
But for visitors/logged out users, the tabs are still visible in the members profile where role is set to Subscriber. My code is based in current_user_can, how can I transform this into profile-I-see-on-page-has-to-be-effected option?
Hope someone can point me in the right direction. Thanks.