Home › Forums › Front-end Issues › acf_form(): unable to select and save data to group sub fields › Reply To: acf_form(): unable to select and save data to group sub fields
You are confusing ACF by trying to include only sub fields. When you do this ACF does not know when the form is submitted that the values belong to sub field and thinks they belong in top level fields. So, basically, you can’t do this.
The way to do this is to include the group and then not show the field you don’t want updated using an acf/prepare_field filter.
// use the field key for sub fields
add_filter('acf/prepare_field/key=field_XXXXX', 'hide_field_on_front');
function hide_field_on_front($field) {
if (!is_admin()) {
// front end of site, do not show field
return false;
}
return $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!
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.