You’ll only want to run this once or so, or else it just ends up being excess processing.
function amkh_set_user_statuses() {
$user_ids = array( 145, 654, 357, 900, 42 );
foreach( $user_ids as $id ) {
bp_registration_set_moderation_status( $id, 'true' );
}
}
add_action( 'admin_head', 'amkh_set_user_statuses' );
The first part would be just an array of user IDs that you want to mark as pending. The foreach loop would iterate over them all, and set the moderation status. Running it on admin_head in my example code because it should only run once. You’ll want to set up your array to match the IDs you want to re-set.
In case curious about this function:
function bp_registration_set_moderation_status( $user_id = 0, $status = 'true' ) {
$user = get_userdata( $user_id );
if ( ! $user ) {
return false;
}
delete_user_meta( $user_id, '_bprwg_is_moderated' );
return update_user_meta( absint( $user_id ), '_bprwg_is_moderated', $status );
}
We check if a user exists with that ID, and then for all that do, we clear out and re-set our meta key/value pair with the status passed.