Replies
- Beuza on November 24, 2017 at 11:10 am in reply to: [Resolved] Profile tabs depending to user role or member type #11841This reply has been marked as private.
- Beuza on November 22, 2017 at 10:18 am in reply to: [Resolved] Profile tabs depending to user role or member type #11820This reply has been marked as private.
- Beuza on November 22, 2017 at 9:59 am in reply to: [Resolved] Profile tabs depending to user role or member type #11817This reply has been marked as private.
- Beuza on November 21, 2017 at 1:57 pm in reply to: [Resolved] Profile tabs depending to user role or member type #11801
Hi Brajesh,
Thank you so much for your help. Unfortunatly for me, it doesn’t work. “Groups” nav continu to appear in all type of member profile. Do you want some access to see more?
I pasted it in my bp-custom.php but nothing new happened:/**
* Remove groups from user profile based on member type.
*/
function buddydev_remove_group_based_on_member_types() {
if ( ! bp_is_user() ) {
return;
}$user_id = bp_displayed_user_id();
if ( ! bp_get_member_type( $user_id, ‘agent’ ) ) {
bp_core_remove_nav_item( ‘groups’ );
}}
add_action( ‘bp_setup_nav’, ‘buddydev_remove_group_based_on_member_types’, 1001 );
/**
* Remove groups from adminbar based on member type.
*
* @param array $nav nav items.
*
* @return array
*/
function buddydev_filter_show_hide_groups_in_adminbar( $nav ) {
if ( ! is_user_logged_in() ) {
return $nav;
}if ( ! bp_get_member_type( bp_loggedin_user_id(), ‘agent’ ) ) {
$nav = array();
}return $nav;
}add_filter( ‘bp_groups_admin_nav’, ‘buddydev_filter_show_hide_groups_in_adminbar’ );
Regards,
Beuza