Borrowing from myself 3 days ago…
function terry_bpro_single_admin_notice( $current_admins ) {
$custom_admins = get_users( 'role=ENTER_ROLE_HERE' );
foreach( $custom_admins as $custom_admin ) {
// append new WP_Users into our passed in array
$current_admins[] = $custom_admin;
}
return $current_admins;
}
add_filter( 'bprwg_bp_notification_users', 'terry_bpro_single_admin_notice' );
This code should handle. The $current_admins
will be an array of WP_User objects who have the “administrator” role, and we push the WP_User objects from your custom role into the array, and pass it back.
Give it a try, make sure to fill in the final result for the role you’re going to make.