1 field.module field_extra_fields_get_display($entity_type, $bundle, $view_mode)

Returns the display settings to use for pseudo-fields in a display mode.

Parameters

$entity_type: The type of $entity; e.g., 'node' or 'user'.

$bundle: The bundle name.

$view_mode: The display mode.

Return value

The display settings to be used when viewing the bundle's pseudo-fields.:

Related topics

File

core/modules/field/field.module, line 970
Attach custom data fields to Backdrop entities.

Code

function field_extra_fields_get_display($entity_type, $bundle, $view_mode) {
  // Check whether the display mode uses custom display settings or the 'default'
  // mode.
  $view_mode_settings = field_view_mode_settings($entity_type, $bundle);
  $actual_mode = (!empty($view_mode_settings[$view_mode]['custom_settings'])) ? $view_mode : 'default';
  $extra_fields = field_info_extra_fields($entity_type, $bundle, 'display');

  $displays = array();
  foreach ($extra_fields as $name => $value) {
    $displays[$name] = $extra_fields[$name]['display'][$actual_mode];
  }

  // Let modules alter the display settings.
  $context = array(
    'entity_type' => $entity_type,
    'bundle' => $bundle,
    'view_mode' => $view_mode,
  );
  backdrop_alter('field_extra_fields_display', $displays, $context);

  return $displays;
}