I’m writing some functions that need to perform actions on users after I import them to WordPress using the “WP All Import” plugin.
It seems that the plugin doesn’t have actions defined for each type of import (Users, Posts, Images, etc) and all imports utilize the pmxi_saved_post
action to handle things that need to happen after each record is saved.
How do you determine which type of import is being performed, so as to not accidentally run actions that are supposed to be for Users (such as, sending a welcome e-mail) on Posts (which may have a colliding ID)?
Function gets current id, so you can check it’s type with WordPress’s
get_post_type($id)
function.For example: