• Resolved mastercoeurl

    (@mastercoeurl)


    Currently without the plugin, I have it setup so the comment form isn’t available for two roles I have on wordpress (banned and unconfirmed). Unfortunately this doesn’t disable wpdiscuz’s form but I do notice that the reply button on individual comments is unavailable for users in those roles. The way I restrict these roles on vanilla wordpress is by using a filter like below. Is it possible to do a similar thing with wpdiscuz? Thanks.

    add_filter( 'init', function()
    {
        $u = wp_get_current_user();
    
        if( $u->exists() && in_array( 'banned', $u->roles, true ) )
            add_filter( 'comments_open', '__return_false' );
    } );

The topic ‘Disable comment form for certain roles’ is closed to new replies.