function multiple_email_form_alter in Multiple E-mail Addresses 5
Implementation of hook_form_alter()
Remove email field from profile edit -- this will be done in address management screen, now.
Parameters
string $form_id:
array $form:
Return value
array
File
- ./
multiple_email.module, line 198 - multiple_email module file
Code
function multiple_email_form_alter($form_id, &$form) {
if ($form_id == 'user_edit' && variable_get('multiple_email_hide_field', true)) {
// We can't remove the email field, but bcb_user_user()'s submit op
// hook will catch the mail field and remove it before it's sent
// to the database. So instead, we hide it.
$form['account']['mail']['#prefix'] = '<div style="display:none;">';
$form['account']['mail']['#suffix'] = '</div>';
// TODO: Put admin-only fields here for changing primary email
// ... or maybe a separate admin email management interface
}
}