Thanks for the code, however, you failed to mention any explanation about the code. What does it do? Where is it run? What does and doesn’t work? Have you debugged it? What are you expecting to happen? What does actually happen? Is there a line in particular that doesnt work? Are you unsure about the logic it needs to perform? Where did you get the code from originally? Is this copy / paste or have you written it all yourself?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users