I got stuck on this today, and all of these solutions seems a little overkill to me. I came up with this, which seems to be working fine for me. I’ve got mine pulling in the palettes from an options page, but the general idea should still be clear.
Hope that helps somebody 🙂
Edit: Apologies, I realise this doesn’t work on repeater fields or other dynamically generated fields. I’ll update this when I fix it.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.