Home › Forums › Add-ons › Repeater Field › update a acf sub_field with the value from a different sub_field › Reply To: update a acf sub_field with the value from a different sub_field
$post_id = get_the_id();
$post_author_id = get_post_field( ‘post_author’, $post_id );
$field[‘readonly’] = 1;
$field_key = “field_573d8df4646da”;// field_key of repeater field
$value = array(
“c_address1” => “Foo”,
“c_address2” => “Bar”
$field = update_field($field_key, $value);
add_filter(‘acf/save_post hook’, ‘my_acf_post_fieldb’);
and it isn’t working either. The fields are not being populated with values.
What do I need to return out of the function? I tried return $post; it doesn’t work either.
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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.