danielleoverman (@danielleoverman)

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @danielleoverman

    Participant

    Solved, found this code snipped from a previous post https://bbpress.org/forums/topic/prevent-users-from-creating-topics-2/ which removed the topic form for everyone but admins and moderators.


    add_filter( 'bbp_current_user_can_access_create_topic_form' , 'rew_only_mods' , 10 , 1) ;
    function rew_only_mods ($retval) {
    // Users need to earn access
    $retval = false;
    //check if admin
    if ( bbp_is_user_keymaster() ) {
    $retval = true;
    }
    //check if moderator
    $role = bbp_get_user_role( get_current_user_id());
    if ($role == 'bbp_moderator') {
    $retval = true;
    }
    // Allow access to be filtered
    return (bool) apply_filters( 'rew_current_user_can_access_create_topic_form', (bool) $retval );
    }

Viewing 1 replies (of 1 total)