I fixed it now!
I changed the 5 lines to this:
add_filter('acf/update_value/type=relationship' ...
.
I also saw you used get_the_title()
, which is a better idea than what I was doing, which was get_post()
.
Now it works, and the values I need are saved in the database.
Also, since I have 5 different fields per post, I use the $field['_name']
plus a string to get seperate a meta_key
per relationship field per post.