#719432 by heyrocker: Document hook_field_extra_fields_alter().
parent
039e7dbec8
commit
acc3e9312c
|
@ -28,6 +28,8 @@
|
||||||
* - weight: The default weight of the element.
|
* - weight: The default weight of the element.
|
||||||
* - view: (optional) The name of the element as it appears in the rendered
|
* - view: (optional) The name of the element as it appears in the rendered
|
||||||
* structure, if different from the name in the form.
|
* structure, if different from the name in the form.
|
||||||
|
*
|
||||||
|
* @see hook_field_extra_fields_alter()
|
||||||
*/
|
*/
|
||||||
function hook_field_extra_fields() {
|
function hook_field_extra_fields() {
|
||||||
$extra = array();
|
$extra = array();
|
||||||
|
@ -61,6 +63,23 @@ function hook_field_extra_fields() {
|
||||||
return $extra;
|
return $extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alter "pseudo-field" components on fieldable entities.
|
||||||
|
*
|
||||||
|
* @param $info
|
||||||
|
* The associative array of 'pseudo-field' components.
|
||||||
|
*
|
||||||
|
* @see hook_field_extra_fields()
|
||||||
|
*/
|
||||||
|
function hook_field_extra_fields_alter(&$info) {
|
||||||
|
// Force node title to always be at the top of the list
|
||||||
|
// by default.
|
||||||
|
if (isset($info['title'])) {
|
||||||
|
$info['title']['weight'] = -20;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @} End of "ingroup field_fieldable_type"
|
* @} End of "ingroup field_fieldable_type"
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue