Creating a Filter that uses an Array as the Parameter

By: Asheley Bailey | Asked: 01/23/2023
ForumsCategory: Paid Help WantedCreating a Filter that uses an Array as the Parameter
Asheley Bailey asked 2 years ago
I'm trying to create a filter that searches through an array of values.   I've already written the code to get the data for the array and create the array. I just can't seem to write a filter code that will search the array for matching field entries.    I'd like to only show the various entries in which the selected form field matches a value in the array.
1 Answers
Best Answer
Bobby Clapp answered 2 years ago
Considering you are talking about comma-separated values, we're probably then talking about this hook -> https://formidableforms.com/knowledgebase/frm_filter_where_val/#kb-check-each-value-from-checkbox
Asheley Bailey replied 2 years ago

Hey Bobby,

I looked at that previously and if I'm understanding correctly the checkboxes they are filter by are apart of the form being loaded in the view. Thus filtering with information submitted on the same form.

My filter criteria is being pulled from a entries on separate form. The criteria is also changing over-time as users interact with the website. Thus it needs to constantly be adjusting the array (or string).

Basically I'm trying to filter with entries from another form.

One question, which may be what's actually causing my issue, how do you actually implement these custom filters? The directions are lacking in that area.

If you're curious, here's my code: https://github.com/ashebashistrash/Formidable-Forms/commit/073b3cd5a02d48d6a62d02681adc0baac7a9cf5c

My filter criteria is held in $alloftheproperties[]

The view ID is 4340

And the field i'd like to filter by is 258

Asheley Bailey replied 2 years ago

I got it. I'm so silly. Thank you for bringing me back to this hook.

I just made a shortcode for the string and then used that filter hook!!!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right