Home › Forums › Quform WordPress › Set dynamic value with custom plugin
Good morning I’m new Quform user, not so expert with php, trying to populate my fields dynamically I have a stupid problem with the return field in the add_filter function.
It works if I use a fixed string or number:
while($row = $result->fetch_array()) { add_filter('quform_element_value_'.$row['id_iscrizione'], function ($value) { return '250'; }); }
but it doesn’t work with a variable, like:
while($row = $result->fetch_array()) { add_filter('quform_element_value_'.$row['id_iscrizione'], function ($value) { return $row['prezzo']; }); }
I know that the array contains valid values, simply testing with php file:
while($row = $result->fetch_array()) { echo $row['id_iscrizione']." | "; echo $row['prezzo']."<br>"; }
I have this results:
Suono | 250 Protools | 200 Producer | 300 Arrangiamento | 300 Mixaggio | 200 Elettronica1 | 150 Elettronica2 | 300 Tecnico-Live | 250 Logic | 200
What did I did wrong?
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
Thank you, it works!
Forgot your password?
Lost your password? Please enter your email address. You will receive mail with link to set new password.
Back to login