You are here

function paragraphs_pack_get_field_view_mode in Paragraphs pack 7

Get/Create view mode field.

This field can be used only on paragraph entity type.

Return value

array An array containing field values.

3 calls to paragraphs_pack_get_field_view_mode()
ParagraphsPackTestCase::testParagraphsPackFieldViewModeCreation in tests/paragraphs_pack.test
Test function for field view mode creation.
ParagraphsPackTestCase::testParagraphsPackFieldViewModeInstanceCreation in tests/paragraphs_pack.test
Test function for field view mode instance creation.
paragraphs_pack_add_field_view_mode in includes/paragraphs_pack.fields_crud.inc
Adds view mode field to a paragraph bundle.

File

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

Code

function paragraphs_pack_get_field_view_mode() {
  $field = _paragraphs_pack_get_field(array(
    'field_name' => PP_FIELD_VIEW_MODE,
    'type' => PP_FIELD_TYPE_VIEW_MODE,
    'entity_types' => array(
      PP_PARAGRAPH_TYPE,
    ),
    'cardinality' => 1,
  ));
  return $field;
}