function field_inheritance_field_inheritance_compute_value_alter in Field Inheritance 8
Same name and namespace in other branches
- 2.0.x field_inheritance.api.php \field_inheritance_field_inheritance_compute_value_alter()
Alter the computed value for an inherited field.
Parameters
array $value: Array of field item values
array $context: Array of context information for the field inheritance, with keys:
- source_field
- source_entity
- destination_field
- destination_entity
- method
File
- ./
field_inheritance.api.php, line 35 - Custom hooks exposed by the field_inheritance module.
Code
function field_inheritance_field_inheritance_compute_value_alter(&$value, $context) {
if ($context['destination_field'] === 'my_field') {
$value[0]['value'] = 'foo';
}
}