own scope
-
i have this created to have a list of the current year til today:
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2); function my_em_scope_conditions($conditions, $args){ if( !empty($args['scope']) && $args['scope']=='this-year' ){ $start_date = date('Y-m-d',strtotime("First day of January", current_time('timestamp'))); $end_date = date('Y-m-d',current_time('timestamp')); $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))"; } return $conditions; }
but on that list there are also current events (not only past events) listed.
Is there a way to have only past events on current years ?
ThanksThe page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘own scope’ is closed to new replies.