0

I analyzed the "Create new account" page of drupal by using hook_form_alter and $form variable. as you see, #form_id value is: "user_register_form" and other elements are as following:

attributes->Array
administer_users->Array
#attached->Array
#cache->Array
account->Array
language->Array
#entity_builders->Array
#process->Array
#parents->Array
user_picture->Array
actions->Array
#form_id->user_register_form
#type->form
#action->form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM
#build_id->form-78GnGyO2iwZsooojZLCOiAw9pYXyDqngJ5C0DU_EzUQ
form_build_id->Array
form_id->Array
#id->user-register-form
#method->post
#theme_wrappers->Array
#defaults_loaded->1
#tree->
#validate->Array
#submit->Array
#theme->Array
contact->Array

I want to remove "Time Zone" element of this form (user_register_form), which of this array elements should I unset to remove that element?

2
  • 4
    Drupal 8 provided admin path at: admin/config/regional/settings where we can un-check the option "Users may set their own time zone." It's working in drupal 8 Mar 7, 2017 at 13:51
  • Honestly, there is no reason not to use the admin here than to add code you do not need.
    – Kevin
    Mar 7, 2017 at 14:39

1 Answer 1

1

EDITED

As @KrishaWeb and @Kevin said: Drupal 8 provided admin path at: admin/config/regional/settings to do it.

1
  • I did not know it was possible to use admin for this. Using admin is better. Mar 7, 2017 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.