Info
- 6 posts
- 2 voices
- Started 4 years ago by bluegeek
- Latest reply from livibetter
- This topic is not resolved
No New posts for members
-
- Posted 4 years ago #
Hello!
I want to restrict new posts in bbpress only to moderators and admins. What is the best way to do it?
I've found a very simple way editing capabilities.php but I would like to avoid editing the source code.
'member' => array( 'name' => __('Member'), 'capabilities' => array( (...) 'write_posts' => false,Thanks.
-
- Posted 4 years ago #
<?php /* Plugin Name: NoNewsPostsForMembers Plugin URI: http://bbpress.org/forums/topic/no-new-posts-for-members Description: No New posts for members */ function NoNewsPostsForMembers($roles) { $roles['member']['capabilities']['write_posts'] = false; return $roles; } add_filter('get_roles', 'NoNewsPostsForMembers'); ?>Put it in
my-pluginswith any filename.php you like. Activate it. Then this should work. -
- Posted 4 years ago #
Thanks, you rule! i'll try it.
BTW what theme do you use at your website (forgetIT).
-
- Posted 4 years ago #
I made my modifications to the original theme Kakumei. If you have any questions about my modifications, you are welcome to ask me.
-
- Posted 4 years ago #
And what about restricting only new posts in some forums (ie. in forum 1 members can start topics but not in forum 2).
Is this also easy in bbpress? (i don't need a fancy admin configuration, just a straight plugin with hardcored values).
Thanks.
-
- Posted 4 years ago #
Have you tried to search one in Extend?
If you find no plugin and you can do code, I think you can check line 18 in /bb-post.php, line 479 in /bb-includes/capabilities.php.
You need to check current user's is allowed to start a new topic in specific forum or not in your filter hook.
Just thoughts, but should work.
PS. I think it's better not to do too much that bbPress can't by default, or you could suffer more after upgrading unless you completely know what you do.
-
You must log in to post.