/**
  * Update event recurrence when a recurring event is saved
  *
  * @param integer $event_id id of the event to update
  * @param array   $data     data defining the recurrence of this event
  *
  * @return void
  */
 public static function updateRecurrenceMeta($event_id, $data)
 {
     // save recurrence
     $current = get_post_meta($event_id, '_EventRecurrence', true);
     if (!empty($data['recurrence'])) {
         $recurrence_meta = wp_parse_args($data['recurrence'], $current);
         // for an update when the event start/end dates change
         $recurrence_meta['EventStartDate'] = $data['EventStartDate'];
         $recurrence_meta['EventEndDate'] = $data['EventEndDate'];
     } else {
         $recurrence_meta = null;
     }
     if (!empty($current) || TribeEventsRecurrenceMeta::isRecurrenceValid($event_id, $recurrence_meta)) {
         $updated = update_post_meta($event_id, '_EventRecurrence', $recurrence_meta);
         TribeEventsRecurrenceMeta::saveEvents($event_id, $updated);
     }
 }
 /**
  * Update event recurrence when a recurring event is saved
  * @param integer $event_id id of the event to update
  * @param array $data data defining the recurrence of this event
  * @return void  
  */
 public static function updateRecurrenceMeta($event_id, $data)
 {
     // save recurrence
     if (isset($data['recurrence'])) {
         $recurrence_meta = $data['recurrence'];
     } else {
         $recurrence_meta = null;
     }
     if (TribeEventsRecurrenceMeta::isRecurrenceValid($event_id, $recurrence_meta)) {
         update_post_meta($event_id, '_EventRecurrence', $recurrence_meta);
         TribeEventsRecurrenceMeta::saveEvents($event_id);
     }
 }
 /**
  * Update event recurrence when a recurring event is saved
  * @param integer $event_id id of the event to update
  * @param array $data data defining the recurrence of this event
  * @return void
  */
 public static function updateRecurrenceMeta($event_id, $data)
 {
     // save recurrence
     if (isset($data['recurrence'])) {
         $recurrence_meta = $data['recurrence'];
         // for an update when the event start/end dates change
         $recurrence_meta['EventStartDate'] = $data['EventStartDate'];
         $recurrence_meta['EventEndDate'] = $data['EventEndDate'];
     } else {
         $recurrence_meta = null;
     }
     if (TribeEventsRecurrenceMeta::isRecurrenceValid($event_id, $recurrence_meta)) {
         $updated = update_post_meta($event_id, '_EventRecurrence', $recurrence_meta);
         TribeEventsRecurrenceMeta::saveEvents($event_id, $updated);
     }
 }