Last active
August 29, 2015 14:23
-
-
Save lenasterg/4c8dfa0834aebe41db70 to your computer and use it in GitHub Desktop.
Buddypress. Restrict group creation to admins, editors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function LS_allow_group_creation( $can_create, $restricted = null ) { | |
| if (current_user_can('edit_others_posts') ) { | |
| return true; | |
| } | |
| else { | |
| return false; | |
| } | |
| } | |
| add_filter( 'bp_user_can_create_groups', 'LS_allow_group_creation' ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it either on theme's functions.php or in /plugins/bp-custom.php