If you want to run your own PHP input check filter for a specific element, you can use the “Custom_filter” option. In order to add your own filter, place the following code block into your (child) theme’s functions.php file:
1 2 3 4 5 6 7 |
add_filter("ezfc_custom_filter_test", "ezfc_test_filter", 0, 2); function ezfc_test_filter($element_data, $input_value) { if ($input_value%2 == 1) { return array("error" => "Error!"); } } |
The filter is called “ezfc_test_filter”. Open up the element you want to apply the filter on, look for the option called “Custom filter” and set its value to ezfc_test_filter:
This filter returns an error message for all even numbers. Please make sure to return an array with an “error” key. Odd numbers will not have a return value so the script can continue with other elements.