A forum bridge plugin has the following:
// Check role is_banned (int 1||0 )
if ( $this->visitor['is_banned'] === 1 ) {
// remove capability from the user and any roles
$user = new WP_User( $user_id );
$user->set_role( 'subscriber');
$user->remove_all_caps();
$user->remove_role( 'subscriber' );
if ( is_multisite() ) {
update_user_status( $user_id, 'spam', 1 );
}
}
The database shows no wp_capabilities. Unfortunately, the WordPress user can still submit comments.
Is it possible to create a role without commenting abilities?
This question only is for settings
How to block a someone from commenting?
I’m curious if a filter could be added to remove the comment form from anyone with a particular role. In other words, create a role called ‘banned’ and if that role is present then call a function which removes the comment form from view OR create a user meta called banned, set to 1, test for presence of flag to show form.
Does anyone have any other ideas?