Skip to content

Instantly share code, notes, and snippets.

@lenasterg
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save lenasterg/4c8dfa0834aebe41db70 to your computer and use it in GitHub Desktop.

Select an option

Save lenasterg/4c8dfa0834aebe41db70 to your computer and use it in GitHub Desktop.
Buddypress. Restrict group creation to admins, editors
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' );
@lenasterg

Copy link
Copy Markdown
Author

Use it either on theme's functions.php or in /plugins/bp-custom.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment