ACF-Pro Compatibility issues

When using ACF Pro, problems occur in Javascript. If ACF Pro is active, an outdated javascript library is loaded by ACF. This hook is used to bypass this problem with ACF.

Error

The following errors occur in the javascript, causing some problems in the backend of WordPress:

Uncaught Error: Option ‘ajax’ is not allowed for Select2 when attached to a <select> element.

Uncaught TypeError: Cannot read property ‘hasClass’ of undefined

Troubleshooting

Add Hook to functions.php, so the select2 version of ACF is raised to 4.0:

Source: https://github.com/woocommerce/woocommerce/issues/12924

 

Alternative

If you do not use ACF but still have problems of this kind, you can try the following option and tick the box:

AT -> Settings -> Advanced Settings -> Disable “select2” fields (activate only with javascript errors)

Do you still have questions? No problem :-)
We are happy to answer your questions in our forum.