change password and confirm password label on profile edit form

Public
</> CopyGet raw version
php
  1. <?php
  2. /*
  3. * Implementation of hook_element_info_alter().
  4. */
  5. function pass_label_element_info_alter(&$type) {
  6. if (isset($type['password_confirm'])) {
  7. $type['password_confirm']['#process'][] = 'pass_label_process_password_confirm';
  8. }
  9. }
  10. /*
  11. * Function pass_label_process_password_confirm() for editing label.
  12. */
  13. function pass_label_process_password_confirm($element) {
  14. if ($element['#array_parents'][0] == 'account') {
  15. $element['pass1']['#title'] = 'New password';
  16. $element['pass2']['#title'] = 'Confirm new password';
  17. }
  18. return $element;
  19. }
  20. ?>