Forums Forums Search & Filter Pro way to filter out latitude/longitude/numerical values via Post Meta tab?

Tagged: ,

Viewing 10 posts - 1 through 10 (of 24 total)
  • Trevor
    #224801
    Anonymous
    #224820

    Would you be able to give me an example of how i could do this to exclude coordinates? There’s a lot to unpack there. It looks like I’d need to loop through the $input_object["options"] array?

    Maybe use some regex? Thoughts?

    Trevor
    #224826

    I can’t give you a specific snippet, but there may be some on our forum. But, yes, looping through the array and matching would be the way to go.

    This search will find many:

    https://support.searchandfilter.com/forums/search/sf_input_object_pre+input_object+return/

    Anonymous
    #224840

    How can I apply this filter? Sorry, still learning as I go. I’ve got the filter I want I believe, just need to know how to implement it on my specific form.

    Trevor
    #224851

    It is quite complex. It runs in the child theme functions.php file. Write something simple and get that working first (like add a character to the start of each string), and work up from there.

    Anonymous
    #224853

    I guess what I need to know is what to input as the $input_object when applying the filter using apply_filter()

    What would $input_object be? How do I access the input object for this event?

    I have the filter written and I think it’ll work.

    Trevor
    #224857

    $input_object is a variable used only in that code, so you don’t alter that. It is set by you changing _my_field_name in this line:

    if($input_object['name']=='_my_field_name')

    Anonymous
    #224859

    so to implement, would it be something like apply_filter('my_filter_name', 'my_field_name', <SF id>) ?

    my question is that the filter accepts 2 args, input_object and form id. so what would be my input_object arg?

    Trevor
    #224867

    What is the ID of the form and what is the field name?

Viewing 10 posts - 1 through 10 (of 24 total)