Support

Account

Home Forums Backend Issues (wp-admin) How can I dynamically filter the list of posts? Reply To: How can I dynamically filter the list of posts?

  • Hi @ebud

    Your are half way through the code needed to perform this AJAX lookup.

    Your PHP filter correctly modifies the query arguments which will take place on page load, however, you will now need to write some JS to listen to a CHANGE event on the trigger field, and then reload the select field.

    The easiest way to do this is to use the jQuery function load. This function allows you to target an element on a page, and just load that HTML!

    What you want to do is load the same wp-admin page, but target the correct select field (either via classes or id attribute). Then just replace the original one with what the AJAX returns.

    Does this help?

    Thanks
    E