You are here

function entity_background_add_field_eb_background in Entity background 7

Creates eb_background field instance.

Parameters

type $entity_type: An entity type for the instance.

$bundle: A bundle for the instance.

$field_label: A field label.

Return value

array An instance information array.

1 call to entity_background_add_field_eb_background()
entity_background_form_paragraphs_admin_bundle_submit in ./entity_background.module
Custom submit handler for entity_background fieldset.

File

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

Code

function entity_background_add_field_eb_background($entity_type, $bundle, $field_label) {
  $field = entity_background_get_field_eb_background();
  $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',
      ),
      'paragraphs_editor_preview' => array(
        'type' => 'hidden',
      ),
    ),
    'widget' => array(
      'type' => 'field_collection_embed',
      'settings' => array(),
      'weight' => 3,
    ),
  ));
  return $instance;
}