How to overwrite a post previously imported

Home Forums Calendar Products Event Aggregator How to overwrite a post previously imported

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1362018

    I’m implementing a way for the aggregator to sync deleted events on the site to import. I already have it working.
    Before making those changes I checked that the aggregator even with the definition of “Event Update Authority” as “Overwrite my event with any changes from the original source.” does not update the status of the article. I would like to know what this code refers to:

    src/Tribe/Aggregator/Tribe/Abstract – Line 1320
    /**
    * Should events that have previously been imported be overwritten?
    *
    * By default this is turned off (since it would reset the post status, description
    * and any other fields that have subsequently been edited) but it can be enabled
    * by returning true on this filter.
    *
    * @var bool $overwrite
    * @var int $event_id
    */

    I can’t find any used code for that variable on the plugin code and any filter with this.

    To force the update of the post i had to comment the if condition, or it will only update de status when it’s a new event:
    src/Tribe/Aggregator/Tribe/Abstract – Line 1315
    // Only set the post status if there isn't an ID
    //if ( empty( $event['ID'] ) ) {
    $event['post_status'] = Tribe__Utils__Array::get( $args, 'post_status', $this->meta['post_status'] );
    //}

    #1362548
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to overwrite a post previously imported’ is closed to new replies.