Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created November 14, 2023 00:05
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/04448f9f82f55dc90d055944893da5e1 to your computer and use it in GitHub Desktop.
Save Pebblo/04448f9f82f55dc90d055944893da5e1 to your computer and use it in GitHub Desktop.
Example of how to use the FHEE__Registrations_Admin_Page___get_orderby_for_registrations_query to filter the orderby arguments.
<?php //Do not include the opening PHP tag if you alreayd have one
add_filter('FHEE__Registrations_Admin_Page___get_orderby_for_registrations_query', 'tw_ee_filter_get_orderby_for_registrations_query', 10, 2);
function tw_ee_filter_get_orderby_for_registrations_query($orderby, $req_params) {
// If ordering by DTT_EVT_Start, don't also order by REG_ID
if(isset($orderby['Event.Datetime.DTT_EVT_start'])) {
unset($orderby['REG_ID']);
}
// Always return the filtered variable
return $orderby;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment