WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] Filtering pods (2 posts)

  1. Matt Lowe
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to filter my pods in a Pods Page.

    I don't know if I'm misunderstanding how filters() works or whether this is a bug, but the filtering doesn't seem to happen. The filter controls are echoed to the page as expected, but in the browser when I choose some filters from the generated dropdowns it makes no difference to the pods that are displayed on the page. I've not seen any bug reports that relate to this, so I'm thinking I must be misunderstanding the docs.

    Here's what I've got so far (simplified) which is pretty much identical to the examples in the docs:

    http://pastebin.com/1nuc8VQh

    The documentation for filters() doesn't state whether the method only outputs the filters form or whether it also applies the selected filters, but the example code on http://podsframework.org/docs/filters/ suggests that it should also filter:

    // Get the items, search is automatically handled
    $pod->find();

    Looking at the docs for find() the only thing I see that relates to filtering is the "WHERE" parameter. Do I need to collect all of the selected filters from the GET/POST variables and turn them into an sql-like where statement to feed to pods->find()? Or something else?

    Any help greatly appreciated!

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Pods find() handles filtering automatically, correct. Upon submission, all relationship fields will be searched when find() builds it's query. If that's not what happens, please submit a bug report on our GitHub so we can look into it at http://pods.io/submit/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic