Thank you for your reply John,
$post_id is now set, but it is always set to 0.
Possibly this is because I am using AJAX to load the form as described in this link.
I did some code tracing and here is the $_POST variable.
[ action => "acf/fields/post_object/query", nonce => "c35b1d6bc1", paged => "1", s => "", field_key => "field_588bcb6648c75" ]
Because post_id is not set it defaults to 0 as defined in
Is this by design?
When I do this query from wp_admin, the post_id IS set.
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!
© 2022 Advanced Custom Fields.