protected function update_post($post_id, array $record)
 {
     $update_authority_setting = Tribe__Events__Aggregator__Settings::instance()->default_update_authority('csv');
     $event = $this->build_event_array($post_id, $record);
     if ('retain' === $update_authority_setting) {
         $this->skipped[] = $event;
         if ($this->is_aggregator && !empty($this->aggregator_record)) {
             $this->aggregator_record->meta['activity']->add('event', 'skipped', $post_id);
         }
         return false;
     }
     if ('preserve_changes' === $update_authority_setting) {
         $event['ID'] = $post_id;
         $event = Tribe__Events__Aggregator__Event::preserve_changed_fields($event);
     }
     add_filter('tribe_aggregator_track_modified_fields', '__return_false');
     Tribe__Events__API::updateEvent($post_id, $event);
     if ($this->is_aggregator && !empty($this->aggregator_record)) {
         $this->aggregator_record->meta['activity']->add('event', 'updated', $post_id);
     }
     remove_filter('tribe_aggregator_track_modified_fields', '__return_false');
 }
Ejemplo n.º 2
0
 protected function update_post($post_id, array $record)
 {
     $event = $this->build_event_array($record);
     Tribe__Events__API::updateEvent($post_id, $event);
 }
Ejemplo n.º 3
0
 /**
  * Update an Event
  *
  * @param int   $postId ID of the event to be modified.
  * @param array $args   Args for updating the post. See {@link tribe_create_event()} for more info.
  *
  * @return int ID of the event that was created. False if update failed.
  * @link     http://codex.wordpress.org/Function_Reference/wp_update_post
  * @see      wp_update_post()
  * @see      tribe_create_event()
  * @category Events
  */
 function tribe_update_event($postId, $args)
 {
     $postId = Tribe__Events__API::updateEvent($postId, $args);
     return $postId;
 }