I just tried adding a user with a space in the name ie ‘test user’
then in dashboard>forums>edit forum>moderators I typed in ‘test user’
it did not pick up the name as I typed it so I had to type the full name, but it did accept it, and added it correctly to the forum database.
per forum moderators are relatively new, and the 15 yr old and 8 year old threads would have been for bbpress version 1.
so on my test site bbpress does allow moderators with spaces in the names.
my next suggestion would be it could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Health Check & Troubleshooting
Then come back
@robin-w Thanks for your feedback, insight and testing on my behalf.
I’ve used the troubleshooter to run the site using 2022 theme and only bbpress. Still won’t allow me to add the user to the forum.
Also the username has the initial of firstname and lastname capitalised so it is more accurately of the format ‘Firstname. Secondname’ – i note that in the ‘all forums’ screen, the moderators columns are all displayed lowercase. So i tried adding the username in the format ‘firstname. secondname’ but to no avail.
To further narrow down the issue I successfully created a new member/user on the site with the actual username ‘Firstname. Secondname’. After upgrading their Forum role to moderator, i attempted to added them as a moderator to a forum. So i added ‘Firstname. Secondname’ (without inverted commas) into the Forum Moderators field and hit update. This then left the field with ‘firstname-lastname’ in place. So when adding the moderator it swaps the ‘dot space’ to a hyphen and makes all characters lowercase.
With this new discovery, I tried adding the original problem username back as a forum moderator, all lowercase with the ‘dot space’ replaced with a hyphen.
But it didn’t accept it.
So I’m confused now as to why it works with one new user in the same format as the old user (which doesn’t work)?
See the above testing in action here
With the new knowledge, I finally retried adding the troublesome username in lowercase with hyphen whilst in a similar troubleshooting set-up but again it didn’t accept it.
Any further thoughts?
Thanks for that – very useful.
Wordpress has a bewildering set of names including username, user display name and user nicename
As far as I can see, bbpress seems to be using the user database setting for user nicename.
So can you try adding this code
add_filter( 'manage_users_columns', 'rew_add_user_nicename', 20, 1);
add_filter( 'manage_users_custom_column','rew_add_user_row', 20, 3 );
function rew_add_user_nicename($columns) {
$new = array();
foreach($columns as $key => $title) {
$new[$key] = $title;
//add the 2 columns after the forum role column
if ($key=='bbp_user_role') {
$new['nicename'] = 'Nicename';
}
}
return $new;
}
function rew_add_user_row($retval = '', $column_name = '', $user_id = 0) {
if ($column_name == 'nicename') {
$user_info = get_userdata($user_id);
$user_nicename = $user_info->user_nicename;
$retval = '-->'.$user_nicename.'<--';
}
return $retval ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
This will add a column to the dashboard>users table to show you exactly what is set as the user nicename. I have enclosed it in arrows eg
–>name here<–
so you can see if there are leading or trailing spaces.
try adding that name to the moderators and see if that works?