• Resolved wpfan1000

    (@wpfan1000)


    Hi,

    I have been looking thru the FAQ, forum, etc to see if the Filters can be exposed like in Views.

    Is that currently possible? If not is there a plan or timeline to do so?

    Thanks.

    I realize building this plugin is a complex endeavor – please don’t think that I see exposed filters as a trivial option to add.

    https://www.ads-software.com/plugins/query-wrangler/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Hi wpfan1000,

    I’ve had exposed filters in the 1.6beta for a while now, but haven’t had time to work much on the plugin until recently. I plan to have exposed filters into the official release within the month. This is definitely my top priority for new features.

    Thread Starter wpfan1000

    (@wpfan1000)

    Awesome! Thanks

    By exposed filters do you many as a nav bar for sorting purposes by the user? If so I am very excited about that.

    If that is not what you are talking about here, could you please direct me to an article that teaches me how to inject the views code into links for sorting purposes.

    Thanks and great plugin.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    I’m going to release a few exposed filters at a time, to ensure they’re working well before implementing for all filters.

    Do you have any specific filters you would like to be able to expose sooner than later?

    Thread Starter wpfan1000

    (@wpfan1000)

    Sorry, I dont quite understand your question.

    This is my view of how Views works:

      A content type will have fields, and Views allows any of those fields to become filters. So which filters are available depends on the fields created.
      Any filter can then be set to be exposed or not.
      If the original field is a select list, and the user enables it to be exposed, then the filter is also a select list, etc.

    Thanks

    Edit – I think I now know what you mean – I would like “Starts with” and “Contains” if that is what you mean.

    Sorry again if I misunderstood your question.

    PS – Awesome dude!!

    Thread Starter wpfan1000

    (@wpfan1000)

    PS I have said it before – I think it is awesome that you are doing this – please let me know if I can help test.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Sorry, I should be more clear.

    Drupal has significantly more reliable data structures than WordPress. It has a Fields API and Forms API, where WordPress has nothing like either. It Drupal, it’s easy to build a solution that meets the expectation of both APIs and works seamlessly, where as WordPress has probably 20 different custom-field related plugins, and nothing to help ease form creation.

    What this plugin does, is takes a bunch of arguments (presented as filters) and dump them into the WP_Query class (https://codex.www.ads-software.com/Class_Reference/WP_Query), then formats the output based on the QW query settings (fields or posts). For the fields and filters, I have to make each one work individually by hand. For filters, I am limited to the arguments allowed by WP_Query, and each of those arguments I have to create an interface for manually. So exposed filters are the same way, in that I have to create the exposed forms for each exposed filter by hand.

    That’s why I am asking which exposed filters are important enough to start with. Once I have a few that work well, I can have more faith in the creation of additional exposed filters.

    Ultimately, this is very limited, but I don’t see a great solution due to lack of standards in how other plugins provide fields. Perhaps an idea would be to make additional plugins for QW than make it work well with a popular custom field plugin, but I don’t have the time atm.

    Thread Starter wpfan1000

    (@wpfan1000)

    I see, thanks for explaining further.

    My requests would be:

    post_type
    orderby
    and Custom Field Parameters

    meta_key (string) – Custom field key.
    meta_value (string) – Custom field value.
    meta_value_num (number) – Custom field value.
    meta_compare (string) – Operator to test the ‘meta_value’. Possible values are ‘!=’, ‘>’, ‘>=’, ‘<‘, or ‘<=’. Default value is ‘=’.

    Especially as an example:

    $args = array(
    ‘post_type’ => ‘product’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘color’,
    ‘value’ => ‘blue’,
    ‘compare’ => ‘NOT LIKE’
    )
    )
    );
    $query = new WP_Query( $args );

    This for me is one of the main uses of Views – to search a custom field with a certain value and specify the compare (string) – Operator to test. Possible values are ‘=’, ‘!=’, ‘>’, ‘>=’, ‘<‘, ‘<=’, ‘LIKE’, ‘NOT LIKE’, ‘IN’, ‘NOT IN’, ‘BETWEEN’, ‘NOT BETWEEN’, ‘EXISTS’ (only in WP >= 3.5), and ‘NOT EXISTS’ (also only in WP >= 3.5). Default value is ‘=’.

    Thanks

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    I’ve added some exposed filters (Post IDs, Post Type, Taxonomy, Post Author) and will be adding more later. The form tag and submit button are now in the query-wrapper.tpl.php, so you could set each up as their own form, with own customizable submit buttons if desired.

    I’ll look at custom fields next.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Exposed filters’ is closed to new replies.