Just replied to your other thread.
Another function to use. Pass in the user ID you want to set to moderated, as the first parameter. The second parameter can be used to also set them as NOT moderated, but if you pass nothing for it, it’ll mark them as moderated.
// Our admin should be moderated!
bp_registration_set_moderation_status( 1 );
// Ok, that was a bad idea, let's not moderate them.
bp_registration_set_moderation_status( 1, 'false' );
/**
* Update our moderation status for a user.
*
* @since 4.2.0
*
* @param int $user_id User ID to update.
* @param string $status Value to update the user meta to.
* @return int Meta row ID that got updated.
*/
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 );
}