Gravity Forms custom validation filter
The gform_after_submission
action hook runs after gform_validation
.
Anyway, assuming you can find a hook that runs earlier, what I would do is store a unique variable for each submitted form using the Transients API's set_transient()
and get_transient()
functions. For example you can create a hidden field in every form which you populate with a random ID. Use this random ID as a key to store and retrieve the Success/Invalid result.
$status
here is a local variable which has never been defined before you try to use it in if-condition. So, it's always null
.Maybe you missed
$status = $validation_result['Result']['Status'];
or something like this before checking the condition.