Commit 79653847 authored by tim.plunkett's avatar tim.plunkett Committed by John Fiala
Browse files

Issue #2117099 by tim.plunkett: Expose attributes as property info.

parent 58f01f5c
......@@ -1380,9 +1380,22 @@ function link_field_item_property_info() {
'label' => t('The URL of the link.'),
'setter callback' => 'entity_property_verbatim_set',
);
$properties['attributes'] = array(
'type' => 'struct',
'label' => t('The attributes of the link.'),
'setter callback' => 'entity_property_verbatim_set',
'getter callback' => 'link_attribute_property_get',
);
return $properties;
}
/**
* Entity property info getter callback for link attributes.
*/
function link_attribute_property_get($data, array $options, $name, $type, $info) {
return isset($data[$name]) ? array_filter($data[$name]) : array();
}
/**
* Implements hook_field_update_instance().
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment