You are here

function _paragraphs_pack_get_field in Paragraphs pack 7

Get/Create field by $field settings.

Helper function.

Parameters

array $field: An array of field settings.

Return value

array A field.

7 calls to _paragraphs_pack_get_field()
paragraphs_pack_get_field_body in includes/paragraphs_pack.fields_crud.inc
Get/Create body field.
paragraphs_pack_get_field_expand in includes/paragraphs_pack.fields_crud.inc
Get/Create expand field.
paragraphs_pack_get_field_file in includes/paragraphs_pack.fields_crud.inc
Get/Create file field.
paragraphs_pack_get_field_image in includes/paragraphs_pack.fields_crud.inc
Get/Create image field.
paragraphs_pack_get_field_items in includes/paragraphs_pack.fields_crud.inc
Get/Create items field.

... See full list

File

includes/paragraphs_pack.fields_crud.inc, line 494
Fields CRUD functions.

Code

function _paragraphs_pack_get_field($field) {

  // Check if the field exists already.
  $field_info = field_info_field($field['field_name']);
  if (empty($field_info)) {
    $field_info = field_create_field($field);
  }
  return $field_info;
}