I don’t know why it might work in one location and not in another. The only thing that I do know is that get_field_object() will fail if the field has never been set and you use the field name but it should work when using the field key.
Welcome
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.