Home › Forums › General Issues › Query post object not working › Reply To: Query post object not working
Is it an error in the post ID or in what is being returned by get_field that’s causing the issue?
The filter you have runs during an AJAX call, so it may be hard for you to see what’s going on. You can write values to your error log and then look in there.
function my_post_object_query( $args, $field, $post_id ) {
$class = get_field('class',$post_id);
error_log($post_id);
error_log($class);
// ...
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.