Reply To: After Import Action

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

#11074
Chris
Keymaster

Hi,

From what you said, it sounds like maybe it would be easier to just delete all posts before the import?

If that won’t work though: ll the normal WordPress actions are called.  The ‘save_post’ action is triggered after each post is created.

There’s also MapPress action that is called during the import:
do_action(‘mappress_update_meta’, $post_id);

Hopefully those actions will be helpful.  If you need to access the import, you can get a list of imports like this:

$imports = TI_Import::get_list();

Get one import where $id is the import ID you want to retrieve:

$import = TI_Import::get_list();

Get import lines for the import – this returns an array of class TI_Import_Line

$lines = $Import->get_imported_posts();

You can take a look at the TI_Import_Line definition to see the fields.  For example:

$lines[0]->post_id