On a Wordpress site that I am working on, client wants 'Moderator' role only to create Topics, which will then be approved (published) by Keymakers (bbpress highest ranked role). Basically, exactly what Contributors can do with posts (create, save as draft and wait for Editor to approve it).
Here is my code in functions.php:
function site_modify_capabilities()
{
$user = new WP_User(get_current_user_id());
foreach($user->roles as $user_role)
{
if($user_role === 'bbp_moderator')
{
/* tried the following: */
/* $user->remove_cap('publish_topics')*/
/* $user->remove_cap('moderate')*/
/* $user->allcaps['publish_topics'] = false; */
}
}
}
add_action('admin_init','site_modify_capabilities');
None of the above worked for me, I am still able to publish new Topics as Moderator. Any ideas what is to be done? Thanks you.