I think this should do it, but check that it works, and try it from topics/replies freshness etc.
add_filter ('bbp_get_user_slug' , 'rew_get_user_slug' ) ;
function rew_get_user_slug ($slug) {
$default = 'users' ;
// Filter & return
return apply_filters( 'rew_get_user_slug', get_option( '_bbp_user_slug', $default ) );
}
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
Sorry, I’m getting a 404 error when I want to view a profile.
hmmm… the code works fine on my test site.
I can only suggest it could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentyfifteen, 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.
Then come back
Thank you for the answer.
It only works if User Base is users and the code you wrote includes users in it.
If I rewrite User Base to user and also to user in the code, it will no longer work with this custom user root.
The default does not need changing.
How are you doing this
‘If I rewrite User Base to user ‘
I thought if I changed it here:
View post on imgur.com
Then I need to change it here too:
add_filter (‘bbp_get_user_slug’ , ‘rew_get_user_slug’ ) ;
function rew_get_user_slug ($slug) {
$default = ‘users‘ ;
// Filter & return
return apply_filters( ‘rew_get_user_slug’, get_option( ‘_bbp_user_slug’, $default ) );
}
Doesn’t actually make a difference if you do both, but it only needs changing in forum user slugs.
I’d suspect that you might need to refresh your browser or clear cache in your site if you are caching.