I wanted to modify main events-list shortcode, but I am stuck now ??
I tried this code:
add_filter( 'em_events_get_default_search', 'my_em_styles_get_default_search', 1, 2);
function my_em_styles_get_default_search( $searches, $array ) {
if( !empty( $array['template']) ) {
$searches['template'] = $array['template'];
}
return $searches;
}
add_filter( 'em_events_output_args' , 'my_em_events_output_args' );
function my_em_events_output_args( $args ) {
if ( isset( $args['template'] ) && !empty( $args['template'] ) ) {
$args['format_header'] = '<ul>';
$args['format_footer'] = '</ul>';
$args['format'] = '<li>#_EVENTLINK - #_LOCATIONLINK, #_EVENTDATES</li>';
$args['orderby'] = 'location_id,event_start_date';
}
return $args;
}
But it does not order well…
All I want is modified list of events when adding shortcode [events_list template=”test”]:
Event 1 - Location 1
Event 3 - Location 1
Event 2 - Location 2
Any idea? Thank you for your help…