Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created September 11, 2018 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshfeck/71c0a71619d0fd94897b2af94b533262 to your computer and use it in GitHub Desktop.
Save joshfeck/71c0a71619d0fd94897b2af94b533262 to your computer and use it in GitHub Desktop.
Remove registrations with "Cancelled" status. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Export__report_registration_for_event',
'my_exclude_cancelled_registrations_csv_report',
10,
2
);
function my_exclude_cancelled_registrations_csv_report(
$params,
$event_id
) {
$params = array(
array(
'OR' => array(
'Transaction.STS_ID' => array(
'NOT IN',
array(
\EEM_Transaction::failed_status_code,
\EEM_Transaction::abandoned_status_code,
),
),
'STS_ID' => \EEM_Registration::status_id_approved,
),
'AND' => array(
'STS_ID' => array(
'NOT IN',
array(
\EEM_Registration::status_id_cancelled,
),
),
),
'Ticket.TKT_deleted' => array('IN', array(true, false)),
),
'order_by' => array('Transaction.TXN_ID' => 'asc', 'REG_count' => 'asc'),
'force_join' => array('Transaction', 'Ticket', 'Attendee'),
'caps' => \EEM_Base::caps_read_admin,
);
return $params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment