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 1 year 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 1 year ago
Considering you are talking about comma-separated values, we're probably then talking about this hook ->
Asheley Bailey replied 1 year 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:

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 1 year 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