Support

Account

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 );