How can I unset an option provided by the User Relationships module on the user edit page? I want to remove the 'Receive e-mail notification of relationship activity' option from the user edit page.

The hook is provided in user_relationship_mailer.module:

/**
 * Implements hook_form_alter().
 */
function user_relationship_mailer_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') &amp;&amp; $form['#user_category'] == 'account') {
    $account = $form_state['user'];
    $access = variable_get('user_relationship_mailer_send_mail', FALSE) &amp;&amp; user_relationships_user_access('maintain @relationship relationships', NULL, $account);
    $form['user_relationships_ui_settings']['user_relationship_mailer_send_mail'] = array(
      '#type'           =&gt; 'checkbox',
      '#title'          =&gt; t('Receive e-mail notification of relationship activity'),
      '#default_value'  =&gt; isset($form['#user']-&gt;data['user_relationship_mailer_send_mail']) ? $form['#user']-&gt;data['user_relationship_mailer_send_mail'] : TRUE,
      '#description'    =&gt; t("If checked, we will e-mail you when there are changes to your relationship status with other users."),
      '#weight'         =&gt; -10,
      '#access' =&gt; $access,
    );
  }
}


So I tried to use unset() like this in my custom module:

/**
 * Implements hook_form_alter().
 */
function MY_MODULE_mailer_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') &amp;&amp; $form['#user_category'] == 'account') {
    $account = $form_state['user'];
    $access = variable_get('user_relationship_mailer_send_mail', FALSE) &amp;&amp; user_relationships_user_access('maintain @relationship relationships', NULL, $account);
    unset($form['user_relationships_ui_settings']['user_relationship_mailer_send_mail']);
  }
}


However, the option is still displayed even after clearing the cache twice.  My custom module's weight is set to 777 and the weight of the user relationship mailer module is 0.  Any idea what I'm doing wrong?
You also don't need to redeclare the $access variable, as you are just removing a field from the form array:

/**
 * Implements hook_form_alter().
 */
function MY_MODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') &amp;&amp; $form['#user_category'] == 'account') {
    unset($form['user_relationships_ui_settings']['user_relationship_mailer_send_mail']);
  }
}


That should be all you need.