@alexsteninge – Sorry for the delay.
So bbpress does not register those roles within WordPress. They are non-existent in WordPress’s perspective. They are essentially a bolt on way to add additional roles.
I’m not sure there is a quick solution as you would need to overwrite our role testing code to account for bbPress being active and then use their helper functions to check those “roles”.
We can look into whether a filter in our code could make that more efficient as well.
Submit an issue on our github and we can follow up there.
Hope that helps.
There must be a place in your plugin where you get the list of role names the bbpress… Somewhere… No matter if they are “real” roles as seen by WP or not. It does not really matter from where it is fetched. I am sure that you have not hardcoded the role names in your plugin. What e.g. if bbpress chose to rename some of the role names?
I don’t mind coding – and I get if the plugin is updated, I will (probably) need to add the code again – but could you tell me where, so I don’t have to look your entire code through?
@alexsteninge – Sorry didn’t see a notification.
That said there are multiple parts, you seem to only be considering one:
1. You need a list of roles to show in the editor so you can choose them, as you guessed we dynamically get this list from WP, so its fresh even if you add roles: https://github.com/JunglePlugins/Content-Control/blob/master/classes/Roles.php#L23
2. You also need to write custom code to check for those roles. As you can see in this code here we check what WP roles the user has when logged in, we get them directly from WP and check if they match what you chose from #1 above.
Now again bbPress does not register roles with WordPress, so they won’t automatically/dyncamically populate into these sections as is. It requires calling bbPress functions in #1 to get and merge an additional list of roles specific to their plugin, as well as calling another of their functions in #2 above to to get a list of their bbPress roles and check those against the ones chosen.
If you use the filters in the 2 sections of code above and put the code in a custom plugin or child-theme you can rest assured it won’t get erased when you update our plugin.
I have added it to our issue tracker for future update: https://github.com/JunglePlugins/Content-Control/issues/25
If you get stuck post on the github issue above and several of our team will see it.
Hope that helps.