Contributors: Don't send inactivity emails to banned users.

Fixes #221
This commit is contained in:
Ian Dunn 2023-02-28 16:16:31 -08:00
parent 04413b9f6c
commit 2880d80e12
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
6 changed files with 36 additions and 5 deletions

View file

@ -795,6 +795,15 @@ function prune_unnotifiable_users( array $contributors ) : array {
unset( $contributors[ $index ] );
continue;
}
// bbPress is not active on this site, so fetch it directly from the database.
global $wpdb;
$forums_role = get_user_meta( $contributor['user_id'], $wpdb->base_prefix . WPORG_SUPPORT_FORUMS_BLOGID . '_capabilities', true );
if ( isset( $forums_role['bbp_blocked'] ) && true === $forums_role['bbp_blocked'] ) {
unset( $contributors[ $index ] );
continue;
}
}
return $contributors;