Support

Account

Home Forums General Issues Add taxonomy terms to custom post type from posts in relationship field Reply To: Add taxonomy terms to custom post type from posts in relationship field

  • This isn’t something I’ve ever tried before, but it would mean having a priority of < 10 on the filter so that you can compare the current value of the relationship field with the previous value of the relationship field.

    There is an example of doing this for biderectional relationship fields https://www.advancedcustomfields.com/resources/bidirectional-relationships/

    But the problem is that you’re dealing with terms, so more than one relationship would be involved. The same terms could be added by other relationship fields.

    So I would amend my previous steps. First off you would need to set up a bidirectional relationship field. You would also need to check all of the posts that are related to all of the posts in the relationship field 2 steps away

    
    current post => relationship field => related posts relationship fields
    

    to figure out what should be added/removed.

    Thinking about it makes my head hurt a bit. I’m sure it’s possible but would take me several hours to work out the details.