See enclosed image. I want to remove this sign in with twitter element because I'm using a block instead. How to do this? On admin/config/services/twitter/signin I have four choices for the connexion button, but I cannot "not display it".

Cheers,

Albert.

Comments

alberto56’s picture

Title: How to remove "Sign in with twitter" button from login form? » Admin setting to display "Sign in with twitter" button on login form
Category: Support request » Feature request

This might be a bit convoluted, but this is how I ended up doing this:

(1) set the weight of your module to come after twitter_signin. You can do this in an install or update hook:

/**
 * Update weight of mysite_custom so form alter hooks called after twitter
 */
function mysite_deploy_update_7125() {
  db_update('system')
    ->fields(array('weight' => 3))
    ->condition('name', 'mysite_custom', '=')
    ->execute();
}

Now an update hook will work:

function mysite_custom_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_login') {
    // remove login with twitter, see https://drupal.org/node/2223221
    unset($form['twitter_signin']);
  }
}

Maybe an admin setting might be better. I'll move this to a feature request.

damienmckenna’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.