You are here

function entity_background_add_field_text in Entity background 7

Create text field instance.

Parameters

type $entity_type: An entity type for the instance.

$bundle: A bundle for the instance.

$field_name: A field name.

$field_label: A field label.

Return value

array An instance information array.

1 call to entity_background_add_field_text()
entity_background_parallax_install in module/entity_background_parallax/entity_background_parallax.install
Implements hook_install().

File

includes/entity_background.fields_crud.inc, line 227
Fields CRUD functions.

Code

function entity_background_add_field_text($entity_type, $bundle, $field_name, $field_label) {
  $field = entity_background_get_field_text($field_name);
  $instance = _entity_background_add_field($entity_type, array(
    'bundle' => $bundle,
    'entity_type' => $entity_type,
    'field_name' => $field['field_name'],
    'label' => $field_label,
    'display' => array(
      'default' => array(
        'type' => 'hidden',
      ),
    ),
    'widget' => array(
      'type' => 'text_textfield',
    ),
  ));
  return $instance;
}