You are here

function uc_addresses_field_extra_fields in Ubercart Addresses 7

Implements hook_field_extra_fields().

Exposes address form field at user register form so the address form can be moved in the UI at admin/config/people/accounts/fields.

Return value

array Definition of extra fields.

File

./uc_addresses.module, line 410
Adds user profile address support to Ubercart.

Code

function uc_addresses_field_extra_fields() {
  $return = array();

  // Only expose the form field if it's enabled in the address settings.
  if (variable_get('uc_addresses_require_address', TRUE) || variable_get('uc_addresses_require_address_admin', TRUE)) {
    $return['user']['user'] = array(
      'form' => array(
        'uc_addresses' => array(
          'label' => t('Address'),
          'description' => t('Ubercart Addresses module address form element on user registration form.'),
          'weight' => 0,
        ),
      ),
    );
  }
  return $return;
}