Tagged: member type, profile, profile tabs, tabs
Hi Brajesh,
Sorry if it’s not allowed to open new topic in this kind of case.
I finally have an issue with the code: member type Player can’t integrate agent’s group. I don’t want group menu tab display in their profile but i would like Players can integrate groups. The goal is to create a kind of agent portfolio for showing to scouts for example.
Could you help me please?
Thanks,Beuza
Provided code:
/** * 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_has_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_has_member_type( bp_loggedin_user_id(), 'agent' ) ) { $nav = array(); } return $nav; } add_filter( 'bp_groups_admin_nav', 'buddydev_filter_show_hide_groups_in_adminbar' );
Hi Beuza,
Thank you for posting.Can you please explain this in more details?
member type Player can’t integrate agent’s group
What do you mean by this integration. In the above code, We are only removing tabs from profile but not stopping any user from joining it or anything.
Thank you
BrajeshThank you for your reply,
I mean, when an agent send an invitation for a player to integrate his group, player can’t accept because of error page: “Oops! That page can’t be found” when he clicks on notification message of invitation. DO you know why?
Thanks,
Beuza
Hi Beuza,
Are you using a 3rd party plugin or is it normal group invitations? I will try to help but not sure if I will be of much help.Brajesh,
No 3rd party plugin, it’s a normal group invitation. The display of invitation reception is located in the Group Tab as sub menu “Invitation”. So when a Player receive group invitation, he can’t to see it because the page doesn’t exist for its member type (Thanks to the appreciate code you did provide me). It’s for that reason i think the solution is to move sub menu “Invitation” in another tab. I just don’t know how to do that. Could you help me please?
Thanks,
Beuza
Hi Beuza,
It needs some time as I still need to check if simply moving tabs will work or we will have to filter at other places.Since it needs significant time(anywhere between 30 mins to 1 hour), I will need atleast a few days. As soon as I am done with my current priority(MediaPress release), I will work on it and help you. I am hoping to hope you with it by Sunday.
Thank you
Brajesh
You must be logged in to reply to this topic.