You can use fel64’s unofficial plugin to add a new Role:
https://bbpress.org/forums/topic/adding-a-new-user-type?replies=6#post-9210
I’ve used this together with Hidden Forums, and it works really nicely!
Thanks!
I modified this approach slightly and ended up with this:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
$groups['mitglied_probe'] = array('Mitglied auf Probe', array('rulord_level1'));
$groups['mitglied'] = array('Mitglied', array('rulord_level1', 'rulord_level2'));
$groups['kernmitglied'] = array('Kernmitglied', array('rulord_level1', 'rulord_level2', 'rulord_level3'));
$groups['koordinator'] = array('Koordinator', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4'));
$groups['leiter'] = array('Leiter', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4', 'rulord_level5'));
foreach ($groups as $key => $g) {
$roles[$key] = $roles['member']; //duplicate member capabilities
$roles[$key] =& $user[$key]; //convenience
$user[$key]['name'] = __($g[0]);
foreach( $g[1] as $capability ) {
$user[$key]['capabilities'][$capability] = true;
}
}
return $roles;
}
?>
It works for me so far
Okay I had to change it a bit:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
//$groups['GROUPNAME'] = array('CAPABILITIES LIKE','HUMAN GROUPNAME', array(EXTRA CAPABILITY, EXTRA CAPABILITY));
$groups['probemitglied'] = array('member','Mitglied auf Probe', array());
$groups['mitglied'] = array('member','Mitglied', array());
$groups['kernmitglied'] = array('member','Kernmitglied', array());
$groups['koordinator'] = array('moderator','Koordinator', array());
$groups['leiter'] = array('administrator','Leiter', array());
foreach ($groups as $key => $g) {
$roles[$key] = $roles[$g[0]]; //duplicate member capabilities
$roles[$key]['name'] = __($g[1]); // change name
foreach( $g[2] as $capability ) {
$roles[$key]['capabilities'][$capability] = true; // add extra capabilities
}
}
return $roles;
}
?>
Hi,
i activate the plugin but i cannot select any new user type in the profile of users. How to select the new roles?