Created
January 22, 2014 18:49
-
-
Save sidharrell/8564820 to your computer and use it in GitHub Desktop.
reject attendees by email address. place blocked email addresses in uploads/espresso/blocks.txt one email per line.
This file contains hidden or 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
| function espresso_reject_attendee_by_email_address($attendee_data) { | |
| if(file_exists(EVENT_ESPRESSO_UPLOAD_DIR."blocks.txt")) { | |
| $blocks = file(EVENT_ESPRESSO_UPLOAD_DIR."blocks.txt",FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); | |
| if(in_array($attendee_data['email'], $blocks)) { | |
| global $wpdb; | |
| $wpdb->delete(EVENTS_ATTENDEE_TABLE, array('id'=>$attendee_data['attendee_id']), array('%d')); | |
| } | |
| } | |
| } | |
| add_action('action_hook_espresso_save_attendee_data', 'espresso_reject_attendee_by_email_address'); | |
| // untill EE version 3.1.37 is released, you'll need to fix the bug on line 572 of includes/process-registration/add_attendees_to_db.php | |
| // was: $ext_att_data_source['attendee_id'] = $attendee_id; | |
| // change to: $ext_att_data_source['attendee_id'] = $ext_attendee_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment