Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restrict post creation

  • @reggiescottjrverizonnet

    Participant

    I am building a new community forum per a client’s request and they would like their members to not have the ability to create post / topics but only comment on topics they create. Is this a feature in bbPress or do I need to add additional plugins?

Viewing 8 replies - 1 through 8 (of 8 total)
  • @robin-w

    Moderator

    Private groups

    and enable topic permissions

    @reggiescottjrverizonnet

    Participant

    Does this allow users to comment on the threads created in the private groups? If they are a member of that group?

    @robin-w

    Moderator

    yes

    @juliannasculpts

    Participant

    Can this be used with the “bbPress Members Only” plugin?

    @robin-w

    Moderator

    I have not tested it with that plugin, so cannot say

    @juliannasculpts

    Participant

    In case anyone is curious, this works with the bbPress Members Only plugin.

    @robin-w

    Moderator

    Thanks for reporting back that it does 🙂

    @shiylo

    Participant

    Bonjour,

    function restrict_bbpress_topic_creation() {
    // VĂ©rifier si l’utilisateur est sur une page de crĂ©ation de sujet
    if ( bbp_is_topic_create() ) {
    // VĂ©rifier si l’utilisateur est un administrateur
    if ( !current_user_can( ‘administrator’ ) ) {
    // Rediriger l’utilisateur vers la page d’accueil du forum
    wp_redirect( bbp_get_forum_url() );
    exit;
    }
    }
    }
    add_action( ‘template_redirect’, ‘restrict_bbpress_topic_creation’ );

    Ce script vĂ©rifie si l’utilisateur essaie de crĂ©er un nouveau sujet et le redirige vers la page d’accueil du forum s’il n’est pas administrateur. Ajoute ce code dans ton fichier functions.php et teste pour t’assurer que ça fonctionne comme prĂ©vu.

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