Thanks for your reply.
I got it to work thanks to your little code-snippet.
The only thing I changed was the populating of the array in the foreach loop: $term_names = $term->name;
By adding these square brackets you ‘tell’ the array to add the new value instead of overwriting it, which is the case if you don’t add those square brackets.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users