yes seem correct the code you use
The code work fine on default, in any way, so it may depend by something else?
Default group for these users is what need to be in phpBB? How they are added in wp, all subscribers?
Add phpBB users to custom WordPress groups/roles
- axew3
- w3all User
- Posts: 2883
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
-
- User ww
- Posts: 42
- Joined: Fri Jan 20, 2017 5:23 pm
Re: Add phpBB users to custom WordPress groups/roles
I apply the different custom groups to users on my site, and set that group as default for them.
In wp they are all subscribers, even after they login when I have set the new default group for them.
- axew3
- w3all User
- Posts: 2883
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: Add phpBB users to custom WordPress groups/roles
I've just try out the addition in any way, also with the custom group plugin and work fine, i was by the way sure about this, after latest release.
So this is very strange.
So this is very strange.
-
- User ww
- Posts: 42
- Joined: Fri Jan 20, 2017 5:23 pm
Re: Add phpBB users to custom WordPress groups/roles
Code: Select all
} elseif ( $phpbb_user_session[0]->group_name == 'Raider' ){
$role = 'raider';
- axew3
- w3all User
- Posts: 2883
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: Add phpBB users to custom WordPress groups/roles
slug(role id)
that is the one you insert when you create the role, and that unfortunately, isn't presented on front end after! SO you can grab it if you've forget, by assigning a role to an user, and check it after, the wp_capabilities value of this user, on wp_usermeta, as suggested on a prev post.
Or you could check where these values are stored for the plugin on db, and see these values in, but i've not check where are stored, i've choose the more simple way above explained: i've assign the role to the user, then i've check it on wp_usermeta -> capabilities column vale, because like you i had forget what i had assing as ID for the custom test WP group.
The ID can't contain spaces for example, nor upper case if not wrong, then
My Custom
can be used as display name
but isn't accepted for the ID that will be maybe
my-custom
And you need to use this, the ROLE ID, not the assigned name.
that is the one you insert when you create the role, and that unfortunately, isn't presented on front end after! SO you can grab it if you've forget, by assigning a role to an user, and check it after, the wp_capabilities value of this user, on wp_usermeta, as suggested on a prev post.
Or you could check where these values are stored for the plugin on db, and see these values in, but i've not check where are stored, i've choose the more simple way above explained: i've assign the role to the user, then i've check it on wp_usermeta -> capabilities column vale, because like you i had forget what i had assing as ID for the custom test WP group.
The ID can't contain spaces for example, nor upper case if not wrong, then
My Custom
can be used as display name
but isn't accepted for the ID that will be maybe
my-custom
And you need to use this, the ROLE ID, not the assigned name.
-
- User ww
- Posts: 42
- Joined: Fri Jan 20, 2017 5:23 pm
Re: Add phpBB users to custom WordPress groups/roles
I just checked wp_usermeta -> capabilities, and the role id I use is correct.axew3 wrote: ↑Sun May 13, 2018 8:48 am slug(role id)
that is the one you insert when you create the role, and that unfortunately, isn't presented on front end after! SO you can grab it if you've forget, by assigning a role to an user, and check it after, the wp_capabilities value of this user, on wp_usermeta, as suggested on a prev post.
Or you could check where these values are stored for the plugin on db, and see these values in, but i've not check where are stored, i've choose the more simple way above explained: i've assign the role to the user, then i've check it on wp_usermeta -> capabilities column vale, because like you i had forget what i had assing as ID for the custom test WP group.
The ID can't contain spaces for example, nor upper case if not wrong, then
My Custom
can be used as display name
but isn't accepted for the ID that will be maybe
my-custom
And you need to use this, the ROLE ID, not the assigned name.
Weird that it dosnt work :S They don't contain spaces nor upper case