problem pulling info from google calendar

Home Forums Calendar Products Event Aggregator problem pulling info from google calendar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1082938
    Ingrid
    Participant

    Hi there, I imported a calendar from google calendar, but it imported it in the wrong timezone. I am not trying to do it again and it says it cannot find it. I used the one-time upload. Wondering if this is preventing me from pulling the information again? If so how can I fix it?

    #1083800
    Nico
    Member

    Hey Ingrid,

    Thanks for reaching out on this, I’ll help you getting the events right!

    Once you import a feed and delete the events the imported save a ‘note’ for that event not to be re-imported. Maybe that’a affecting you here?

    If so, please add the following snippet to your theme’s functions.php file, and reload the admin page until all deleted events notes are cleared:

    /*
    * Deletes the saved copy of "deleted" events generated by iCal Importer
    * This allows you to re-import events. The script deletes 50 instances per page load
    */
    $posts = get_posts( array( 'numberposts' => 50, 'post_type' =>'deleted_event') );
    if (!empty($posts)) {
    foreach ($posts as $post) {
    wp_delete_post( $post->ID, true);
    }
    } else {
    echo 'Done deleting!';
    }

    Once you are done you can comment the script or remove it from the file.

    To prevent this behaviour in the future, add this other bit of code:

    /*
    * Prevents iCal importer from saving a copy of "deleted" events
    * This means when you rerun an import, it will reimport any events you previously deleted
    */
    function tribe_ical_dont_save_deleted () {
    $ical_importer = Tribe__Events__Ical_Importer__Main::instance();
    remove_action( 'before_delete_post', array( $ical_importer, 'deletedEventSave' ) );
    }
    add_action( 'wp_loaded', 'tribe_ical_dont_save_deleted' );

    Please let me know if this helps,
    Best,
    Nico

    #1089748
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘problem pulling info from google calendar’ is closed to new replies.