This is my guess on order when creating/editing a post:
I don’t know what order they all fire, but, for example, acf/init fires during the WP init action. This is probably the earliest of them all. For the rest, most of them are called during the WP action or filter of the same name, like admin enqueue scripts, admin_head.
During form processing, that is saving values, some of them will not be run at all, these include acf/prepare_field and acf/render_field. The first when is run before a field is rendered and the second is run to render the field. Since there’s no rendering of fields during the save process they would not be called.
acf/load_field, acf/load_value, acf/validate_value, acf/update_value are all run on each field where the documentation mentions them. I do not believe that acf/load_value is called at all during form processing, saving of a value. The only exception to this would be if you have added an acf/save_post filter and you’re getting the values of the fields for some reason.
acf/save_post is run after WP inserts or updates a post. This could also run after WP inserts or updates a term or user. This is also run when an options page is being saved, but since there is not WP object envolved here I wouldn’t be sure.
As for the rest of them, I don’t know for sure. But they all involve specific fields and would only run when those fields are needed. I do know that validate attachment runs before update_value and that validate_value runs before update_value, but this only happens if for some reason the form did not validate during the AJAX request. validate_value also runs on each field during the AJAX validation request when no values are saved.
Not sure this helped you at all or why you’re looking for the information. I have the vague cloud in my head of the order that things happen in WP and most of the actions/filters in ACF are tied to WP filters.
The topic ‘Form Processing Hook Chart’ is closed to new replies.
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!