Created
November 14, 2023 00:05
-
-
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.
This file contains 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
<?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