Support

Account

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

  • I tried:

    function my_acf_post_fieldb($post){
    $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(
    array(
    “c_address1” => “Foo”,
    “c_address2” => “Bar”
    )
    );
    $field = update_field($field_key, $value);
    return $field;
    }
    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.