Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Adding a new User Type

It’s pretty simple, but you need a plugin to do it. Here’s how it probably goes.

<?php
/*
Plugin Name: Add lusers
Description: adds the luser role
Author: fel64
*/
add_filter('get_roles', 'addlusers');

function addlusers( $roles ) {
$roles['luser'] = $roles['member']; //duplicate member capabilities
$roles['luser'] =& $luser; //convenience
$luser['name'] = __('Luser');
$lusercaps = array('be_sucky', 'be_awesome', 'see_secrets');
foreach( $lusercaps AS $cap ) {
$luser['capabilities'][$cap] = true;
}
return $roles;
}
?>

I hope that’s not too complex, I took some shortcuts. Basically all you have to do is put that in an empty text file, save as lusers.php (or whatever), upload to your server and activate. You just need to customise a few lines: change all the instances of luser to whatever you want, and customise the extra capabilities you want them to have if any. These capabilities will be on top of the ones normal members have. (Poo, I just realised the $bb_roles->add_role() function makes it all much easier. Ah well, at least this way you can use the member as your base.)

Then go to the members’ profiles and make them all lusers. Or whatever.

Skip to toolbar