Home › Forums › Calendar Products › Event Aggregator › Updating current events
- This topic has 5 replies, 4 voices, and was last updated 7 years, 9 months ago by jadecreative.
-
AuthorPosts
-
June 21, 2016 at 3:31 pm #1130120jadecreativeParticipant
Hi, I’m looking at using this importer for another project and wanted to follow up to see if an original issue has been resolved with this extension.
Essentially, the feed wasn’t bringing through updates to current events. So if an event was updated in the feed, the update didn’t come through to the existing event. This relates to changes to event details or the event being deleted completely.
Is there a way to allow the feed to ‘replace all existing events with events in the feed?’ so that we get updated events?
Thanks, Patrick.
June 22, 2016 at 2:49 pm #1130616AndrasKeymasterHi Patrick,
Welcome back!
At the moment the iCal importer only imports new events. It cannot automatically update events that have already been imported.
The only way to update already imported events is to first delete the event, second totally purge the event from the database. For this second move you will need the following 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 admin page load
* (Re)load any admin page until you see the message "Done deleting!" Then remove snippet.
* 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' );
Let me know if this answers your question.Cheers,
AndrasJune 22, 2016 at 3:00 pm #1130634jadecreativeParticipantThanks for your reply, is there any plan in place to accommodate this need as I’d imagine a few users would like for existing events to be updated on import?
Based on what you have said above we have to manually delete the event from WP admin > then purge > then fetch? Can this be automated in some way so that our client doesn’t have to do this?
June 23, 2016 at 10:44 am #1131120AndrasKeymasterHello again Patrick,
At the moment we are not working on this feature. If this is something you would like as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.
Most probably that process could be automated with some customization work. However we are limited in doing that and providing support for customizations.
Here’s a list of freelancers who could help you out with this and who are not affiliated with us.
Let me know if you have any follow up questions.
Cheers,
AndrasJuly 8, 2016 at 9:35 am #1137314Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Updating current events’ is closed to new replies.