Removing user capabilities
I’m trying to remove the publish_topics capability from the subscriber role when using the bbpress wordpress plugin.
I checked here for reference, but it may not apply to the plugin version.
here’s the code I am using in my theme’s function.php
$role_object = get_role( 'subscriber' );
$role_object->remove_cap( 'publish_topics' );
add_action( 'init', 'bbp_remove_subscriber_caps' );
When I print the $role_object it shows:
[capabilities] => Array
[read] => 1
[level_0] => 1
[edit_topics] => 1
[publish_replies] => 1
[edit_replies] => 1
[assign_topic_tags] => 1
Which should mean that subscribers can’t create new topics… but the option still shows up on their dashboard. It does however say “You cannot create new topics at this time.” on the forum page within the site. So it seems to be partially working…
Is this a bug or am I just doing it wrong?
- You must be logged in to reply to this topic.