I’ve written a small function that is trigged when saving a a cpt ‘myCPT’
I first clears the post term of a custom taxnomomy ‘custom-tax’
then it get the value of an acf relationship field ‘myRelationshipField’
loop throug the results to
get the value of a meta field ‘shadow_term_id’ of the related post ; it actually get the id of a term of my custom-tax
and use this value to add this term to the original post
it works nicely in the post editor,
but if Iedit my post from the post list, with the bulk editor, changing post statut for instance, then it delete the terms, and do not re-add them. The relationship is kept, and I can “restore” the terms by saving the post from the editor again.
Do you guys have any clues what’s going on, and how to fix that ?