At least for single-site, I believe filtering this should be enough:
$minimum_cap = apply_filters( 'bp_registration_filter_minimum_caps', $capability );
$capability
in single site will be “manage_options”. You’ll be able to help me test if replacing that with something like “delete_users” would be enough.
If so, then I’m likely going to change the default to “delete_users”. You will need a way to amend those roles to have that capability, for what it’s worth, unless you provide some other capability that those roles have already.
Hi Michael,
thanks for getting back so quickly. I am fairly new to adding capabilities.
I tried this:
/*** allow keymaster to approve signups .......*/
$minimum_cap = apply_filters( 'bp_registration_filter_minimum_caps', $capability );
$role_object = get_role( 'keymaster' );
$role_object->add_cap( 'delete_users' );
/***/
but i must admit i am totally guessing at this 😉
This will get them the menus to show up:
/**
* Filters the minimum role required to see BPRO pages.
*/
function freakency_bpro_custom_user_role( $capability ) {
return 'delete_users';
}
add_filter( 'bp_registration_filter_minimum_caps', 'freakency_bpro_custom_user_role' );
The rest, meaning getting the role the capability, will be up to you, whether through your add_cap() above or some capabilities management plugin.
perfect. thanks for your help.
Marcus
Sounds good. Thanks for helping confirm working order, Marcus.