function field_extra_fields_get_display
field_extra_fields_get_display($entity_type, $bundle, $view_mode)
Returns the display settings to use for pseudo-fields in a given view mode.
Parameters
$entity_type: The type of $entity; e.g., 'node' or 'user'.
$bundle: The bundle name.
$view_mode: The view mode.
Return value
The display settings to be used when viewing the bundle's pseudo-fields.
Related topics
File
- modules/field/field.module, line 688
- Attach custom data fields to Drupal entities.
Code
function field_extra_fields_get_display($entity_type, $bundle, $view_mode) { // Check whether the view 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, ); drupal_alter('field_extra_fields_display', $displays, $context); return $displays; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.module/function/field_extra_fields_get_display/7.x