Created
June 2, 2017 13:24
-
-
Save joshfeck/9a38f938e940d7c36656320a04e7ff37 to your computer and use it in GitHub Desktop.
Adds post meta value to the event search on Event Espresso events admin list table. **Note:** The query will be slower!
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 | |
//* 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', 'my_custom_search_field', 10, 2); | |
function my_custom_search_field( $where, $data ) { | |
if (isset($data['s'])) { | |
$search_string = '%' . $data['s'] . '%'; | |
$where['OR']['Post_Meta.meta_value'] = array('LIKE', $search_string); | |
} | |
return $where; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment