Hi Brajesh,
I hope you are doing well.
I’m having some trouble with the Profile Tab Pro plugin. I’ve made a new tab for a specific user role and designated that tab as the default landing page for that user role. I’m finding that the ‘default tab’ gets applied to all users and roles.
For example, I added a tab called ‘Rollins College’ and defined it being added only to the user role ‘rollins23’ and then visible to ‘anyone’. Then I checked ‘set it as default component’ and then saved. What I am seeing is that although the user role ‘rollins23’ profile works, all other buddypress profiles shows a ‘403 error’ which occurs since they don’t have that tab activated. I would like to keep all other landing pages unchanged (i.e., their profile tab).
Please help!
Sujee
Hi Sujee,
You are correct about the default tab. It applies to all or none.if you can tell me about your member types and provide the slugs for applying to these types, I can help with code.
You will have to remove the default selection for the tab from the profile tabs plugin in that case.
Regards
BrajeshHi Brajesh,
Thank you for getting back so quickly.
My member types are as follows:
1. Admissions Counselor Member Type with slug = ‘admissions-counselor’
2. Student Member Type with slug = ‘student’
3. Guidance Counselors Member Type with slug = ‘guidancecounselors’
4. Coaches Member Type with slug = ‘coaches’
5. Other Member Type with slug = ‘other’
Thanks!
Sujee
Just to expand a bit – The admissions counselor member types are where the new Profile Tabs will be added and default direct to the new tab. For all the other member types, I wanted to keep the original default landing at Profile.
Hope that makes sense.
Sujee
Hi Brajesh – just a kind reminder. I look forward to testing out the code your provide.
Sujee
Hi Sujee,
You can use the following code/** * Conditionally update the landing tab. */ function buddydev_set_member_type_based_default_component() { if ( bp_is_user() && bp_has_member_type( bp_displayed_user_id(), 'admissions-counselor' ) ) { define( 'BP_DEFAULT_COMPONENT', 'groups' ); //change groups with the slug of the tab you want to be default. } } add_action( 'bp_init', 'buddydev_set_member_type_based_default_component',3 );
Please make sure to change ‘groups’ with the slug of the tab you want to be default for the member type.
Hope this heleps.
Regards
BrajeshHi Brajesh,
The code worked but a small problem with slug names. All members under member type ‘admissions-counselor’ will have the same slug ‘home’ but of course their permalink will be different since their member user names are different. However, I am unable to keep the slug ‘home’ same for all ‘admission-counselor’ default home pages and use the code you provided. Is there a trick to get around this?
Sujee
Hi Sujee,
I am sorry but I could not understand you last reply.We are not dealing with permalink here. It is for the default tab, so should work just fine if you click on a user’s link.
Regards
Brajesh
The topic ‘ [Resolved] BP Profile Tab Pro – Default Tab Error’ is closed to new replies.