Skip to content

Instantly share code, notes, and snippets.

@elimn
Created August 4, 2015 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elimn/13b32fb7763826df78d2 to your computer and use it in GitHub Desktop.
Save elimn/13b32fb7763826df78d2 to your computer and use it in GitHub Desktop.
MT | TEC | Prevent iCal importer from saving a copy of "deleted" events
<?php
/*
* 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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment