Created
February 13, 2018 02:47
-
-
Save KaineLabs/31ab51e4d40c854ffccc31b64c0d97d4 to your computer and use it in GitHub Desktop.
Exclude spam users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Exclude Spam Users | |
*/ | |
function youzer_md_exclude_spam_users( $retval ) { | |
global $wpdb; | |
$sql = "SELECT ID FROM {$wpdb->users} WHERE user_status != 0"; | |
$exclude_spam_users = $wpdb->get_col( $sql ); | |
if ( ! empty( $exclude_spam_users ) ) { | |
$retval['exclude'] = implode( ',', wp_parse_id_list( $exclude_spam_users ) ); | |
} | |
return $retval; | |
} | |
add_filter( 'bp_before_has_members_parse_args', 'youzer_md_exclude_spam_users', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment