[PATCH] AJAX search
-
Referring to http://wordpress.org/support/topic/plugin-events-manager-ajax-on-search-page, which is closed for replies, we tried again to set up AJAX search by adding this to wp-config.php:
define('EM_AJAX_SEARCH', true);Last time we had issues with multilingual (qTranslate) category names coming out as a jumble. This worked now without any problem, likely due to customizations we had done in placeholders. However, two issues remained, of which one we fixed outright and wish to share the patch with you.
- The scope used in AJAX search was always ‘future’. Adding this to templates/templates/events-list.php makes the one in EM settings be used instead.
if ( defined( 'DOING_AJAX' ) ) { $args['scope'] = get_option('dbem_events_page_scope'); } - The all day text still comes out as “All DayKoko päivä”, even though it should be either “All Day” or “Koko päivä”. We could attempt the same placeholder hack that seems to have solved the issue for the categories, but we’d prefer to do this nice and proper and contribute a patch towards EM core.
That All day text comes from Settings > Formatting > Default event list format:{all_day}<!--:en-->All Day<!--:--><!--:fi-->Koko päivä<!--:-->{/all_day}. The part in templates/templates/events-list.php that prints this text is:if(get_option('dbem_event_list_groupby') ){ $args['mode'] = get_option('dbem_event_list_groupby'); $args['date_format'] = get_option('dbem_event_list_groupby_format'); echo em_events_list_grouped($args); }Where’s the correct place to add the filters that this AJAX events list misses (but normal list doesn’t)?
- The scope used in AJAX search was always ‘future’. Adding this to templates/templates/events-list.php makes the one in EM settings be used instead.
The topic ‘[PATCH] AJAX search’ is closed to new replies.