Home › Forums › General Issues › Trouble with acf/fields/post_object/query Filter › Reply To: Trouble with acf/fields/post_object/query Filter
sorry, I missed the obvious, and not talking about the array, I personally never use shorthand for anything so I missed that too.
But what I missed is your add_filter() code. If you want more than 1 argument passed to your filter then you need to tell WP how many is should pass. In this case it should be 3
add_filter( 'acf/fields/post_object/query/name=my_field', [ $this, 'my_filter' ], 10, 3 );
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.