I still think it’s me who is making the strange question 😉
I hope I will give this one a last try before I have to give up, since I cannot help my customer a step further.
I will give you a step by step list of what I have done and want to have:
1. I just have a front end search form in which the customer uses two fields to insert the ‘height’ and the ‘width’ of something
2. I also wnat to use S&F to search/filter on a third field (which does not need to be filled in by the customer, since that field should be the calculation of height x width. It is kind of unlogical to let the user fill in the calculated value of something so simple. Right?
3. So I don’t need to see all the fields on the screen, I just need to get access to the two fields I mentioned. I found the names of them: _sfm_breedte (width) and _sfm_hoogte (height)
4. I thought I could use the ‘Edit Query Arguments’ routine, and use it for the ID of my S&F serach (in my case 3954). I thought I could get the field values in that routine and make the needed calculation of the third field value there.
5. Yes and that field might be made invisible in the front end, since the user does not need to see it. So you in ACF Pro I use the three fields, but only two shown in the search form. Ik hope that makes the appraoch for my request more clear.
Questions:
1. Is the routine I want to use the right one?
2. So, how do I access and get the values of the two defined fields? I don’t need to dispaly them, just use them to make a calculation
Example of non-PHP code in written words:
function filter_function_name( $query_args, $sfid ) {
//if search form ID = xxxx, the do something with this query
if($sfid==xxxx)
{
get me the value of ‘height’
}
return $query_args;
}
add_filter( ‘sf_edit_query_args’, ‘filter_function_name’, 20, 2 );