field_extra_fields

Versions
7
field_extra_fields($bundle_name)

Registry of pseudo-field components in a given bundle.

Parameters

$bundle_name The bundle name.

Return value

The array of pseudo-field elements in the bundle.

Related topics

▾ 4 functions call field_extra_fields()

field_attach_extra_weight in modules/field/field.attach.inc
Retrieve the user-defined weight for a 'pseudo-field' component.
field_attach_form in modules/field/field.attach.inc
Add form elements for all fields for an object to a form structure.
field_attach_view in modules/field/field.attach.inc
Generate and return a structured content array tree suitable for drupal_render() for all of the fields on an object. The format of each field's rendered content depends on the display formatter and its settings.
field_ui_field_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; listing of fields for a content type.

Code

modules/field/field.module, line 378

<?php
function field_extra_fields($bundle_name) {
  $info = &drupal_static(__FUNCTION__, array());

  if (empty($info)) {
    $info = array();
    $bundles = field_info_bundles();
    foreach ($bundles as $bundle => $bundle_label) {
      // Gather information about non-field object additions.
      $extra = module_invoke_all('field_extra_fields', $bundle);
      drupal_alter('field_extra_fields', $extra, $bundle);

      // Add saved weights.
      foreach (variable_get("field_extra_weights_$bundle", array()) as $key => $value) {
        // Some stored entries might not exist anymore, for instance if uploads
        // have been disabled or vocabularies were deleted.
        if (isset($extra[$key])) {
          $extra[$key]['weight'] = $value;
        }
      }
      $info[$bundle] = $extra;
    }
  }
  if (array_key_exists($bundle_name, $info)) {
    return $info[$bundle_name];
  }
  else {
    return array();
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.