Home › Forums › Bug Reports › Fields on acf/pre_submit_form does not receive format_values treatment › Reply To: Fields on acf/pre_submit_form does not receive format_values treatment
the acf/load_field and acf/pre_submit_form happen before you switch to blog.
acf/load_field happens when the field groups are loaded. ACF does not retroactively load field groups for the site when you switch_to_blog().
plugins_loaded happens before init. ACF initializes field groups on init. What you are doing by calling get_field() before the init hook is causing ACF to prematurely initialize on the blog you are switching to during that action. ACF may or may not correct things when the init hook fires.
Why is the field not formatted correctly?
The rules for formatting are in the field definition.
return Both from your code. ACF cannot do this formatting if it cannot find the field definition. ACF cannot find the field definition because it is not loaded. Therefor ACF returns whatever is in the DB, in this case it is a text value because the field is either a select field that only allows one value or it is a radio type field.
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!
© 2022 Advanced Custom Fields.