Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'em_get_scopes','my_em_scopes_modfuture',1,1);
- function my_em_scopes_modfuture($scopes){
- $my_scopes = array(
- 'future-mod' => 'Modified Future'
- );
- return $scopes + $my_scopes;
- }
- 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']=='future-mod' ){
- $start_date = date('Y-m-d',current_time('timestamp'));
- $start_time = date('H:i:s',current_time('timestamp'));
- $conditions['scope'] = " (event_end_date >= CAST('$start_date' AS DATE) AND event_start_time > CAST('$start_time' AS TIME) AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL) ";
- }
- return $conditions;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement