You could try checking this thread: https://www.ads-software.com/support/topic/using-scope-for-a-custom-display-list/#post-10856544
You could also try this snippet:
add_filter( 'em_object_build_sql_conditions_args', 'custom_add_one_week_scope_filter' );
function custom_add_one_week_scope_filter( $args ) {
if( isset( $args['scope'] ) && $args['scope'] == '1-weeks' ) {
add_filter( 'em_object_build_sql_conditions', 'custom_add_one_week_scope' );
}
return $args;
}
function custom_add_one_week_scope( $conditions ) {
$EM_DateTime = new EM_DateTime(); //the time, now, in blog/site timezone
$start_date = $EM_DateTime->getDate();
$end_date = $EM_DateTime->modify('+7 days')->getDate();
$conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE))";
if( !get_option('dbem_events_current_are_past') ){
$conditions['scope'] .= " OR (event_start_date < CAST('$start_date' AS DATE) AND event_end_date >= CAST('$start_date' AS DATE))";
}
if( !empty($conditions['scope']) ){
$conditions['scope'] = '('.$conditions['scope'].')';
}
return $conditions;
}
Then to use it:
[events_list scope="1-weeks"]<p>#_EVENTLINK will take place at #_LOCATIONLINK on
#_EVENTDATES at #_EVENTTIMES</p>[/events_list]
-
This reply was modified 6 years, 3 months ago by
Tim Vergara.