i have a form that takes first name, last name, email and date.
i am able to pre populate email and date ok, but not the first name or last name.
can you see what is wrong with the code?
the fields have been set to allow for dynamic updating - with first name parameter
"firstname" and last name parameter "lastname"
changes were made in the theme's function.php file.
add_filter('gform_field_value_user_firstname', create_function("", '$value = populate_usermeta(\'firstname\'); 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(\'lastname\'); 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;' ));
add_filter("gform_field_value_today", "populate_today");
// 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);
}
function populate_today(){
$format = "m\/d\/Y";
$today_value = date($format);
return $today_value;
}