Introducing BuddyPress Default Group Tab plugin
We are doing a 17 plugins before BuddyPress 1.7 series and here goes the third one.
BuddyPress Default Group tab plugin allows site admins/group admins on BuddyPress based social network to control the default landing page of any group.
Features:-
- Allow controlling the default landing page of a group
The good thing is, you can control which group has which component set as default landing page.
For example, In a group fashion, you can make the activity as the default landing page while in group education, you can make forum as the default landing page.
Faq:-
Does it work with BuddyPress Plugins using Group Extensions?
Indeed, it does.
Screenshots:-
Settings Screen:-
You can view this screen by visiting Individual Group->Admin->Settings Page
Example landing page:-
This is what happens when members is set as default tab.
Download & Installation:-
Link: https://buddydev.com/plugins/bp-default-group-tab/
This is a premium plugin, so I am publishing some code that you can use to achieve almost same functionality. The plugin handles it in much better way and gives more flexibility but I want you to be able to use this feature even if you are not a Premium member on BuddyDev. So, here is the code which you can modify according to your requirements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | function bpdev_custom_group_default_tab( $default_tab ) { $group = groups_get_current_group(); // get the current group // if current group is not set, return the default tab. if ( empty( $group ) ) { return $default_tab; } // you may create a switch/if else to default to some other tab based on group slug or group id whichever you prefer // here I am testing against slug. switch ( $group->slug ) { // to test against group id use $group->id. case 'alpha-beta': // the group sug. $default_tab = 'members'; // the landing component. break; case 'study-group': // the group slug. $default_tab = 'forums'; // the landing component. break; // go ahead add some more. } return $default_tab; } add_filter( 'bp_groups_default_extension', 'bpdev_custom_group_default_tab' ); |
Credits: Thanks to Jeff for asking this in BuddyPress.org forum
Do you plan to use this plugin? Is there anyway we can improve this? please do let me know in comments.
PS: Don't forget to check BuddyDev daily, we are back and I mean it:) and we will keep doing what we do the best, helping you to Build the awesomeness with BuddyPress 🙂
PPS: We are playing the game of plugins for next 15 days, I am inviting you to join me on this journey and take another step toward making better social networks with BuddyPress. Any ideas, suggestions for plugins are most welcome 🙂
You totally rock.
THANK YOU SO VERY MUCH.
After code from another site broke many features, this worked straight 'out of the box'. Awesome. #deepbows #gratitude
You are most welcome.
I am glad that the code helped you. Thanks for stopping by 🙂