criscom
11/15/2015 - 7:16 PM

#template.php: change elements for the user login block

#template.php: change elements for the user login block

<?php
// add below code into a template php file where "master2015" is the name of the theme
// change elements on the user_login_block
// https://www.drupal.org/node/1167712#comment-6168328
// https://www.evernote.com/l/ARBwFvpMr5RNc6P-0Qmf1XcqIb5dpb3MySM
// See also: http://websmiths.co/blog/very-introduction-drupals-hookformalter

  function master2015_form_user_login_block_alter(&$form, &$form_state, $form_id) {

  $form['name']['#title'] = t('Username'); // change the name of the first input element
  $form['pass']['#title'] = t('Password'); // change the name of the second input element
  $form['actions']['submit']['#value'] = t ('Anmelden'); // change the name of the action-submit button
  unset($form['links']['#markup']); // hide markup for link to "Forgot password"
}