You are here

function subuser_update_7202 in Subuser 7.2

Adds field_subuser_limit field instance.

File

./subuser.install, line 61
Provides installation functions.

Code

function subuser_update_7202() {

  // Check if our field is not already created.
  if (!field_info_field('field_subuser_limit')) {
    $field = array(
      'field_name' => 'field_subuser_limit',
      'type' => 'text',
    );
    field_create_field($field);

    // Create the instance on the bundle.
    $instance = array(
      'field_name' => 'field_subuser_limit',
      'entity_type' => 'user',
      'label' => 'Subuser Limit',
      'bundle' => 'user',
      'settings' => array(
        // Here you inform either or not you want this field showing up on the registration form.
        'user_register_form' => 1,
      ),
      'widget' => array(
        'type' => 'textfield',
      ),
    );
    field_create_instance($instance);
  }
}