function social_gdpr_form_user_register_form_alter in Open Social 8.9
Same name and namespace in other branches
- 8.3 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 8.4 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 8.5 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 8.6 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 8.7 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 8.8 modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 10.3.x modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 10.0.x modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 10.1.x modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
- 10.2.x modules/custom/social_gdpr/social_gdpr.module \social_gdpr_form_user_register_form_alter()
Implements hook_form_FORM_ID_alter().
Move the GDPR checkbox into the account fieldset if it's available.
File
- modules/
custom/ social_gdpr/ social_gdpr.module, line 79 - Contains social_gdpr.module.
Code
function social_gdpr_form_user_register_form_alter(&$form, FormStateInterface $form_state) {
if (isset($form['data_policy'], $form['account'])) {
$form['account']['data_policy'] = $form['data_policy'];
unset($form['data_policy']);
// Provide it with a weight so it'll sit at the bottom relative to the other
// user registration form fields.
$form['account']['data_policy']['#weight'] = 100;
}
}