Home › Forums › General Issues › acf/pre_save_post with a Post Object › Reply To: acf/pre_save_post with a Post Object
and which one of those fields is the post object field?
A post object field stores a post ID and does not store the post title of the post that is selected. If you want to store information about that other post then you will need to get that other post, it is also a string in $)POST and not an INT
$post = get_post(intval($_POST['acf']['key_for_post_object_field']));
// use title of post
$value = $post->post_title;
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.