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?
I can confirm that WP 5.5 causes JS errors for the color picker on the acf_form_head() function;
Tested with no other plugins and twenty twenty theme.
Your hep is appreciated
This should be corrected in WP 5.5.1
Thanks for reaching out!
Sadly, it isn’t working in 5.5.1 either. I’ve submitted a support ticket and the team is looking for a solution. Downgrading WP to a version prior to 5.5 seems to be the fix for now.
Yes the JS Error issue persists after updating to 5.5.1
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.
It has been fixed in the 5.9.1 update, thanks Elliot and team!
I can confirm “wp is not defined” it´s fixed on ACF 5.9.1.
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!
© 2020 Advanced Custom Fields. Subscribe