Reply To: After Import Action

Home Forums TurboCSV Support After Import Action Reply To: After Import Action

#11077
yellowhousedesign
Participant

Hey Chris,
Appreciate the response. The data will actually be used throughout the rest of the system, so deleting all of them before-hand probably won’t be a good idea. I think that ‘mappress_update_meta’ action may be where I want to do the check.

It sounds like I could use that action to:

Grab all of the imported posts with: $lines = $Import->get_imported_posts();
Then grab all of the posts that current exist (using get_posts())
Compare the IDs in each and then use http://codex.wordpress.org/Function_Reference/wp_delete_post to remove the ones that don’t match

Does the TI_Import class also hold the template name in the event I don’t want to do this for every “type” of import? Thanks again!