Home › Forums › General Issues › acf/pre_save_post with a Post Object › Reply To: acf/pre_save_post with a Post Object
You need to know the acf key of that other field and you can set it. Just like your example, but use the field key where you have “s”
$_POST['acf']['s'] = {value to set};
as I noted, the acf post object field will have a string value of the post ID. If you want to populate the other field with the ID then you’d just copy that value over. If you want to use other information about the post then you’ll need to get the post and get that other information as I explained above. In all cases, you need to provide a value that is in the same format that ACF is expecting to be submitted by the field you’re trying to auto populate.
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.