i have a field “notes” that i need to add to a Custom post type and to the user profile.
Right now it’s working but what i need to do is synchronize both fields so if someone writes a note on the acf field on the user profile it automatically saves the content into the acf field on the custom post type and the reverse way too.
use an acf/save_post action. Check the $post_id in this function to see if it is a user or a post that’s being updated. I would test to make sure it’s the right post type as well if it’s a post. Get value from the notes field that’s being updated, look up the other side, either the user or the post, and update the field for the other one. The biggest problem will be with updating posts. You’ll need to do a query to get a list of posts that match the user id and then loop through all of those posts and update the field for each one, even if that is only 1 post.