All events not importing

Home Forums Calendar Products Event Aggregator All events not importing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1128344
    Kelly Adkins
    Participant

    Setting up my iCal import. Worked perfectly the first time for all my events from today into the future (I have events up to 2018), except that I somehow imported duplicates of every event. So I deleted all and started from scratch. In between that, I also entered my license and the iCal importer plugin updated automatically.

    Now the import won’t work. If I leave it set to today, it imports no events from now to the future (I have more than 700). If I set it to the beginning of this month or any date in the past, it imports all events only up to this day. It seems to have internally set an end date of today, which I see no option to change?

    #1128347
    Kelly Adkins
    Participant

    Ah, I see that if you import an event and manually delete it, it will not re-import. How do I start over from scratch and get the importer to see my events as brand new? I did delete the recurring import and started from beginning, I’m not working from the same import.

    #1128656
    Andras
    Keymaster

    Hi Kelly,

    Welcome to the forums. Let me help you with that.

    Take the below snippet and paste it into your theme’s function.php file.

    Now, when you load an admin page this snippet will run and it will delete the leftover events from your database. It deletes them in a 50 batch, so that the server doesn’t give you a timeout, so you might need to load an admin page quite a number of times. It will always give you a message at the top ’50 events have been deleted etc.’

    When it’s done, then you’ll see the message: “Done deleting!”.

    When you see this, remove the snippet from your functions.php, so it doesn’t give you any troubles. Or alternatively you can comment out the line that starts with add_action. Just put two slashes before like this: //add_action …

    So here’s the snippet:
    /*
    * 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
    * Code by Nico; enhancement by Andras
    */
    function del_deleted_events () {
    $posts = get_posts( array( 'post_type'=>'deleted_event', "posts_per_page" => 50, 'post_status' => 'trash', ) );
    if (!empty($posts)) {
    foreach ($posts as $post) {
    wp_delete_post( $post->ID, true);
    }
    echo '<p style="background-color:yellow;z-index:1;text-align:right;">50 deleted events removed, refresh again</p>';
    } else {
    echo '<p style="background-color:yellow;z-index:1;text-align:right;">Done deleting!</p>';
    }
    }
    add_action( 'admin_init', 'del_deleted_events' );

    Looking forward to hear the results.

    Cheers,
    Andras

    #1134824
    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 4 posts - 1 through 4 (of 4 total)
  • The topic ‘All events not importing’ is closed to new replies.