Ok, I finally managed to make my forms work again. Loading select2 full instead of minified version in wp-multilang makes the error disappear. But probably this should be fixed on ACF side as the error appeared with the last update. See this thread (https://wordpress.org/support/topic/incompability-with-acf/#post-15117328) for details.
Now there is a documentation about the use of polylang with ACF: https://polylang.pro/doc/working-with-acf-pro/
Should be in the class-NAMESPACE-acf-field-FIELD-NAME-v5.php file right? I can’t find that, the functions which look promising are only being called on the edit screen…
Great, thanks! Using format_value() works out great to return a div as $value for rendering the map.
Where would I put the javascript in this case, is there something like input_admin_enqueue_scripts() but for front end?
It’s not necessary to write a custom update_value function, saving multiple values in one field can be done simply by choosing the right input field names.
Have a look at this thread, where it is explained in detail: https://support.advancedcustomfields.com/forums/topic/need-help-with-creating-new-field-type-with-acf/
Thanks for your hint, saving evaluation data as array solved my issue.
I implemented this using a standard ACF form group loaded from the single.php template and adding the following hooks:
$value = get_post_meta( $post_id, $field['name']);
$value[get_current_user_id()] = $value;
$value = get_post_meta( get_the_ID(), $field['name']);
$field['value'] = $value[0][get_current_user_id()];
Thanks for your thought. Can ACF store data in post_meta or would I have to do that directly with WordPress API?
Could you outline the steps to follow? I have some programming experiences but know little about ACF and WordPress API.
Hi indextwo,
I’m fighting with the same the same behavior which happens to all users with role != admin.
How did you solve it? I don’t get your answer from your reply which is marked as topic solution.
Thanks for help
thanks @acf-support, that worked fine.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.