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
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 