I have a form with a trigger on it. The gform_field_value_ filter triggers twice: once for the form and once for the javascript. It does so without passing in the value from the previous pass.
I need to do something like this:
add_filter( 'gform_field_value_my_rand', 'gform_field_value_my_rand' );
function gform_field_value_my_rand( $value ){
if( !$value ) :
$value = 'sliceofcheese' . sprintf( "%05d", rand(0,99999) );
endif;
return $value;
}
Is this deliberate behaviour?