I want to update the post and edit the value of an existing field with a sequence number after the entry has been created at gform_after_submission
hook.
The requirement is to update a single field value in the same post and then update the post. I I found this documentation but not that helpful.
And tried the following but it’s updating all the fields:
add_filter( "gform_save_field_value", "set_field_value", 10, 4 );
function set_field_value( $value, $lead, $field, $form ){
if( $form['id'] != 1 || $field['id'] != 19 )
return;
$value = "xxx";
return $value;
}
I think your logic is a bit off I would check IF it IS the right field rather than if it’s not and do something like this:
You may be able to do it without the
else
and just return value once but if I remember right (and the docs show) both are needed.Or you could do it with your current code:
}
just make sure you return the value not just return the function
Here is a link to the correct docs page Also Gravity Forms has a support form of its own for users who have paid for the product. Lastly, Check out their example pastie
I solved the issue using the below code: