Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 1, 2019 14:19
Show Gist options
  • Select an option

  • Save joshfeck/45ab71386226095fc228b399e1ed4b45 to your computer and use it in GitHub Desktop.

Select an option

Save joshfeck/45ab71386226095fc228b399e1ed4b45 to your computer and use it in GitHub Desktop.
Filter function to add event search by Venue city. Event Espresso 4. This will affect the speed of the page load for search results.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__Events_Admin_Page__get_events__where',
'ee_add_venue_city_search_field',
10,
2
);
function ee_add_venue_city_search_field( $where, $data ) {
if (isset($data['s'])) {
$search_string = '%' . $data['s'] . '%';
$where['OR']['Venue.VNU_city'] = array('LIKE', $search_string);
}
return $where;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment