I updated WP to 5.5 and I am using the latest version of ACF PRO, now when my front-end form loads a color picker field, the console throws the following error:
Uncaught ReferenceError: wp is not defined on color-picker.js?ver=5.5:14
Resulting in another error on acf-input.min.js?ver=5.9.0:1:
Uncaught TypeError: e.wpColorPicker is not a function
It doesn’t happen on the back-end though. It seems to be a problem on the Color picker script’s side. Other plugins face the same issue, but their temporary solutions don’t seem to work here.
Is there any way to (temporarily) fix this for the acf_form function?
From what I’ve found the 5.5 update broke millions of sites. This is why I generally do not update until after the first minor release for a major release and sometimes not even then. I just wait and let everyone else update so that the bugs can be reported and hopefully fixed. I’m working on a new site now that I must revert to 5.4… because fool that I am I keep sites in development up to date to make sure things will not break 😛
Having same problem and i ended in the same as kcalv said about acf_form_head();
And for what i could see the problem start since this change on the wp core:
See how it´s added a new “__ = wp.i18n.__;” into the ColorPicker var.
I guess many other changes in core about i18n and how js uses translations are the problem here, sine i saw many other plugins that are having the same not defined “wp”.
For what i see this is a change that affects many other things, all related on how js uses translations, basicly this:
This removes the usage of
wp_localize_script() for passing translations to the script and instead adds the translatable strings in the script directly through the use of
wp.i18n and its utilities.
Hope this help to find the solution.
You must be logged in to reply to this topic.
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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.