This filter hook is run on the element value before it is saved in the database. This hook can be used to encrypt values, which can later be decrypted using the quform_set_value_from_storage
hook.
quform_get_value_for_storage
This filter hook is run on all form element values in all forms.
Example
1 2 3 4 5 | add_action('quform_get_value_for_storage', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3); |
add_action('quform_get_value_for_storage', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3);
Parameters
$value
–string
– the element value in storage format$element
–Quform_Element_Field
– the element instance$form
–Quform_Form
– the form instance
quform_get_value_for_storage_X
This filter hook is run on all form element values in a single form.
Example
12
3
4
5
| add_action('quform_get_value_for_storage_1', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3); |
add_action('quform_get_value_for_storage_1', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3);
- On line 1, replace the number
1
with the form ID
Parameters
$value
–string
– the element value in storage format$element
–Quform_Element_Field
– the element instance$form
–Quform_Form
– the form instance
quform_get_value_for_storage_X_X
This filter hook is run on a single form element value.
Example
12
3
4
5
| add_action('quform_get_value_for_storage_1_3', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3); |
add_action('quform_get_value_for_storage_1_3', function ($value, Quform_Element_Field $element, Quform_Form $form) { $value = my_encrypt_element_value($value); return $value; }, 10, 3);
- On line 1, replace
1_3
with the element unique ID
Parameters
$value
–string
– the element value in storage format$element
–Quform_Element_Field
– the element instance$form
–Quform_Form
– the form instance