Title: Event Closed Control
Last modified: August 30, 2016

---

# Event Closed Control

 *  Resolved [Abhinav1331](https://wordpress.org/support/users/abhinav1331/)
 * (@abhinav1331)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/event-closed-control/)
 * Hello Team,
 * I need your help in this plugin, how can i set that event will consider as a 
   past event in the calender when the event time start.
 * Thanks & regards,
    Abhinav
 * [https://wordpress.org/plugins/the-events-calendar/](https://wordpress.org/plugins/the-events-calendar/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [nicosantos](https://wordpress.org/support/users/nicosantos/)
 * (@nicosantos)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/event-closed-control/#post-6591808)
 * Hi Abhinav,
 * Not sure about what you are asking here? An event will be considered ‘past event’
   when the EndTime has passed. To tweak this you’ll need to alter the events query.
   While we cannot support this type of customization I’ll leave a snippet here 
   that might help you getting started:
 *     ```
       add_filter('tribe_events_pre_get_posts', 'filter_tribe_all_occurences', 100);
   
       function filter_tribe_all_occurences ($wp_query) {
       	if ( !is_admin() )  {
       	  $new_meta = array();
       	  $today = new DateTime();
   
       	  // Join with existing meta_query
       	  if(is_array($wp_query->meta_query)) {
       	  	$new_meta = $wp_query->meta_query;
       		}
   
       	  // Add new meta_query
       	  $new_meta[] = array(
       	          'key' => '_EventStartDate',
       	          'type' => 'DATETIME',
       	          'compare' => '<=',
       	          'value' => $today->format('Y-m-d H:i:s')
       	  );
       	  $wp_query->set( 'meta_query', $new_meta );
       	}
       	return $wp_query;
       }
       ```
   
 * Just add it to your theme’s function.php file and again, this is unsupported 
   and you might need to tweak this a bit to work.
 * Best,
    Nico
 *  Thread Starter [Abhinav1331](https://wordpress.org/support/users/abhinav1331/)
 * (@abhinav1331)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/event-closed-control/#post-6591897)
 * Thanks for The support Nico.
 * But my site is [http://thebelasco.com/](http://thebelasco.com/) and it is based
   on los angeles.
 * What i facing is that, either there are some couple of hours for the event . 
   it shows the event as a past event.
 * Warm Regards,
    Abhinav
 *  [BeardedGinger](https://wordpress.org/support/users/joshlimecuda/)
 * (@joshlimecuda)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/event-closed-control/#post-6591908)
 * Hey Abhinav,
 * Thanks for following up!
 * I think I may be understanding what you’re describing here. To clarify, you have
   events that are showing up as past on a given date even though they may be happening
   later in that day?
 * As an initial step, have you tried checking the timezone on your WordPress installation?
   It could be that it is set to a different timezone and that time is passing prior
   to the event occurring in California.
 * Let me know if this helps.
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Event Closed Control’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

 * [the event calender](https://wordpress.org/support/topic-tag/the-event-calender/)

 * 3 replies
 * 3 participants
 * Last reply from: [BeardedGinger](https://wordpress.org/support/users/joshlimecuda/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/event-closed-control/#post-6591908)
 * Status: resolved