contact_user_profile_form_submit($form, FormStateInterface $form_state)
Submit callback for the user profile form to save the contact page setting.
function contact_user_profile_form_submit($form, FormStateInterface $form_state) { $account = $form_state->getFormObject()->getEntity(); if ($account->id() && $form_state->hasValue('contact')) { \Drupal::service('user.data')->set('contact', $account->id(), 'enabled', (int) $form_state->getValue('contact')); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!contact!contact.module/function/contact_user_profile_form_submit/8.1.x