Skip to content
Advertisement

Variable not working when an integer works fine in Gravity Forms GFAPI::get_entries filter

I am trying to understand why a variable that contains an integer cannot but used to replace the integer in GFAPI::get_entries field_filters value. This works:

JavaScript

This does not work:

JavaScript

where $child_entry_ID is 72. Of course

JavaScript

prints “72”

JavaScript

I use it like this

JavaScript

In the case that works, my arrays print correctly, in the case that doesn’t work, I get “Array().

Advertisement

Answer

So it seems that when I put $child_entry_ID which is:

JavaScript

It echoes out to an integer (72 in this case) but is not interpreted as it’s result (72) but as a string ({entry_id}). I used the function rgar to change $child_entry_ID :

JavaScript

And this works where the value is really interpreted as the result (72) and my search criteria interprets correctly.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement