First, I use ACF PRO 5.11.4 and the latest WordPress 5.8.3
I’m wondering why the taxonomy fields doesn’t work in my ACF front end form. Everything runs fine in localhost (Wamp).
Then I tried in production environment with 2 different webhosts and I get the same error message “Loading failed“.
It’s the exact same site in localhost and production.
No error in DEBUG mode (WP_DEBUG, WP_DEBUG_LOG and SCRIPT_DEBUG).
I tried with all plugins disabled except ACF PRO.
The same scripts are well loading in the same order in local and prod when I look at in in the console.
Seriously I think there is a parameter to change at my webhost but I don’t know what.
ANd it seems to be a general problem with most of webhost.
When using a select field for taxonomy fields it uses Select2. An AJAX request is done to get the terms. If loading fails it means that the AJAX request is returning something other than what is expected. This could be because of an error on the server or it could be caused by some output that should not be happening.
So I made it works as Dropdown List, do you know how ?
I saved my Taxonomy field as Radio Button (that works).
Then re-saved my Taxonomy field as Dropdown List and tadaaa! Works fine.
I don’t explain why. Previously I saved multiple times the field Taxonomy field without changing the Dropdown List setting and it was not solving the problem. But switching to radio button -> Save, then choose Dropdown -> Save make it works.