Skip to:
Content
Pages
Categories
Search
Top
Bottom

No New posts for members

  • 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.

Viewing 5 replies - 1 through 5 (of 5 total)

  • livibetter
    Member

    @livibetter

    <?php
    /*
    Plugin Name: NoNewsPostsForMembers
    Plugin URI: https://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-plugins with any filename.php you like. Activate it. Then this should work.

    Thanks, you rule! i’ll try it.

    BTW what theme do you use at your website (forgetIT).


    livibetter
    Member

    @livibetter

    I made my modifications to the original theme Kakumei. If you have any questions about my modifications, you are welcome to ask me.

    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.


    livibetter
    Member

    @livibetter

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar