Home › Forums › Add-ons › Options Page › Can't save options, empty translation › Reply To: Can't save options, empty translation
OK, I figured that out, it was my mistake. The issue was from a custom field type, for which I wrote some javascript, like documented in Adding custom javascript to fields.
I introduce a dependency to acf-field-group.js, which forced loading it on every pages (and therefore activated the unwanted validation which was using unloaded internationalized string).
I put my script file back on footer, removed the dependency, and it all works fine.
The reason I first added this dependency (which is not documented), is that I had JS errors “acf is not defined” in pages where acf is not present (as wp_enqueue_script adds it to every pages). Before using acf.add_action, I added a test to ensure it is pertinent to go on :
if (window.acf) {
It seems that adding the dependency to acf-input.js do not cause issues, and may be a proper solution (to ensure WP loads custom scripts after it).
Thanks a lot for your support.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.