All in question, and the code here come from Gravity. Any idea why I get errors ?
Code paste in functions.php :
// populate the field with "user_firstname" as the population parameter with the "first_name" of the current user
add_filter('gform_field_value_user_firstname', create_function("", '$value = populate_usermeta(\'first_name\'); return $value;' ));
// populate the field with "user_lastname" as the population parameter with the "last_name" of the current user
add_filter('gform_field_value_user_lastname', create_function("", '$value = populate_usermeta(\'last_name\'); return $value;' ));
// populate the field with "user_email" as the population parameter with the "email" of the current user
add_filter('gform_field_value_user_email', create_function("", '$value = populate_usermeta(\'user_email\'); return $value;' ));
// this function is called by both filters and returns the requested user meta of the current user
function populate_usermeta($meta_key){
global $current_user;
return $current_user->__get($meta_key);
}