function hook_node_registration_default_values_alter in Node registration 7
Implements hook_node_registration_default_values_alter().
A weird form alter while still in node_registration_form().
You should instead use the normal form alter: hook_form_FORM_ID_alter()!
Parameters
array &$form:
array &$values:
array $context:
- node:
- registration:
- user:
File
- ./
node_registration.api.php, line 89
Code
function hook_node_registration_default_values_alter($form, $values, $context) {
$node = $context['node'];
$registration = $context['registration'];
$user = $context['user'];
// This will be automatically assigned to $form['field_fullname'][LANGUAGE][0]['value'].
$values['field_fullname'] = format_username($user);
}