Home › Forums › ACF PRO › Sync two fields in different cpt › Reply To: Sync two fields in different cpt
I don’t understand the connection, but yes.
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.
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.