Home › Forums › General Issues › Trouble with acf/fields/post_object/query Filter › Reply To: Trouble with acf/fields/post_object/query Filter
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.
https://www.advancedcustomfields.com/resources/acf_form/#ajax
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 acf_field_post_object->get_ajax_query()
Is this by design?
EDIT:
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!
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.