Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
link
Commits
79653847
Commit
79653847
authored
Oct 12, 2014
by
tim.plunkett
Committed by
John Fiala
Oct 12, 2014
Browse files
Issue #2117099 by tim.plunkett: Expose attributes as property info.
parent
58f01f5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
link.module
link.module
+13
-0
No files found.
link.module
View file @
79653847
...
...
@@ -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().
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment