Support

Account

Home Forums Backend Issues (wp-admin) Changing query of Post Object field upon changing the field Reply To: Changing query of Post Object field upon changing the field

  • Sorry I have not gotten back to you on this, been a little busy on a project.

    Where I think you’re going wrong, there are 2 places.

    The first thin is that you need to return JSON from your AJAX function

    
    echo json_encode($postitems);
    

    The second thing is that you can’t add an action during the AJAX request because the action will no longer exist when ACF makes it’s AJAX request.

    What you need to do is alter the ACF AJAX request rather than doing your own to include your extra values and then in your filter use these additional values to alter the query that ACF is doing. Unfortunately, that’s as far as I can take you. While I think that it’s possible to do this, I don’t know exactly how and it would take a lot of digging and time for me to figure it out. There aren’t any examples of doing this that I know of.