I’m wondering if anyone here has experience importing data to bidirectional relationship fields using WP All Import.
I have three CPTs that are all interconnected: Locations, Providers, and Services. Each CPT has bidirectional relationship fields for the other two.
I know I have the target fields mapped correctly, because when I manually edit any of these posts, the relationships get updated in the reciprocal posts, i.e. if I edit John Doe (provider) and assign him to New York (location), if I then edit New York (location), I will see John Doe as one of its providers.
I’m importing data into these CPTs using WP All Import with the ACF add-on. The import works, and the relationships are assigned in one direction, but the reciprocal relationships are not created during the import. I thought manually editing the posts might sync the relationship, but it doesn’t, unless I manually delete the relationship, save, and then manually re-enter it.
I assume there’s a hook that fires off on a manual edit that isn’t firing when WP All Import runs. I realize it just may not be possible to get WP All Import to do this, so I’m considering writing my own small utility that will blast through all of the posts and write the missing relationships. If anyone has done something like that, I’d appreciate a code sample to save some time in working out what needs to be done. Thanks.