Support

Account

Home Forums General Issues How to auto select ACF relationship field based on taxonomy selection Reply To: How to auto select ACF relationship field based on taxonomy selection

  • The only way that you can do this is if there is some connection between the old taxonomy and the new post type.

    If this connection exists or if there is some data in each that can be relied on that can be used, for example if you can guarantee that post slug and the term slug will match. Otherwise you may need to add a taxonomy field to the new post type to select the old taxonomy so that you have some kind of a connection.

    If this connection can be made then I would create an acf/load_value filter for the relationship field. In this filter, if the value is empty then I would get the value of the old taxonomy field, get the posts related to that term and populated the value of the relationship field with the array of IDs that this returns.