January 31, 2019 at 6:59 am
I’ve added 2 filters to the attendees searcher in the page ‘espresso_registrations’ and they work perfectly.
This is the code I’ve used to add the filters.
add_filter(
'FHEE__Registrations_Admin_Page___get_where_conditions_for_registrations_query',
'my_custom_search_field_reg',
10,
2
);
function my_custom_search_field_reg( $where, $request ) {
if (isset($request['s'])) {
$search_string = '%' . sanitize_text_field($request['s']) . '%';
$where['OR*search_conditions']['Answer.ANS_value'] = array('LIKE', $search_string);
$where['OR*search_conditions']['Answer.ANS_value'] = array('LIKE', $search_string);
$where['OR*search_conditions']['Attendee.ATT_phone'] = array('LIKE', $search_string); }
return $where;
}
I would like to filter attendees by their promotion codes. I’ve looked in the database and they are in the field ‘LIN_desc’ of the ‘_line_item’ table and in the field ‘PRO_code’ of the ‘_promotion’ table.
Is it possible to add this field to the searcher filters? How could I do it?
Thank you beforehand
|