Home › Forums › General Issues › ACF Front End Form Revisions › Reply To: ACF Front End Form Revisions
Hi!
So I’m encountering the exact same problem.
I add all the meta fields to _wp_post_revision_fields
add_filter('_wp_post_revision_fields', function ($fields, $post) {
if ($post && $post['post_type'] === 'visit') {
$json = TEMPLATEPATH.'/acf-json/group_5b311d2d73933.json';
if (is_file($json)) {
$visits_fields = json_decode(file_get_contents($json));
if (is_array($visits_fields) && $visits_fields->fields) {
foreach ($visits_fields->fields as $field) {
if ($field->name) {
$fields[$field->name] = $field->label;
}
}
}
}
}
return $fields;
}, 10, 2);
Everything works as expected on the admin side, but when updating “visit” from the fontend – a revision is created, but no “change”.
When I edit post from backend then revision is also created but shows all the custom fields also which were added via the filter.
I don’t use the acf_form on frontend. Just a simple custom form and wp_insert/update_post and update_field(“<hash>”, value); functions.
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.