Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restrict post creation


  • reggiescottjr
    Participant

    @reggiescottjrverizonnet

    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

    @robin-w

    Private groups

    and enable topic permissions


    reggiescottjr
    Participant

    @reggiescottjrverizonnet

    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

    @robin-w

    yes


    Julianna
    Participant

    @juliannasculpts

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


    Robin W
    Moderator

    @robin-w

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


    Julianna
    Participant

    @juliannasculpts

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


    Robin W
    Moderator

    @robin-w

    Thanks for reporting back that it does 🙂


    shiylo
    Participant

    @shiylo

    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