Created
April 1, 2019 14:19
-
-
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.
This file contains hidden or 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 | |
| //* 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