Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Forked from joshfeck/example_csv.php
Last active October 4, 2022 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/cf166f8ac6fc709d2f76390e90a427e0 to your computer and use it in GitHub Desktop.
Save Pebblo/cf166f8ac6fc709d2f76390e90a427e0 to your computer and use it in GitHub Desktop.
Only pull Approved registrations by default, order ASC by TXN_ID and Reg_count
<?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',
'tw_ee_registration_for_event_set_RAP_ASC',
10,
2
);
function tw_ee_registration_for_event_set_RAP_ASC($query_params, $event_id) {
$query_params = [
[
'STS_ID' => EEM_Registration::status_id_approved,
'Ticket.TKT_deleted' => ['IN', [true, false]],
],
'order_by' => ['Transaction.TXN_ID' => 'asc', 'REG_count' => 'asc'],
'force_join' => ['Transaction', 'Ticket', 'Attendee'],
'caps' => EEM_Base::caps_read_admin,
];
if ($event_id) {
$query_params[0]['EVT_ID'] = $event_id;
} else {
$query_params['force_join'][] = 'Event';
}
return $query_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment