function entityreference_dragdrop_get_selected_options in Entity Reference Drag & Drop 7
Returns selected options.
1 call to entityreference_dragdrop_get_selected_options()
File
- ./
entityreference_dragdrop.module, line 207 - Provides a Drag & Drop widget for entity-reference fields.
Code
function entityreference_dragdrop_get_selected_options($items, $options) {
// Build an array of selected items in id => label format.
$selected = array();
foreach ($items as $item) {
foreach ($options as $bundle => $entities) {
if (array_key_exists($item['target_id'], $entities)) {
$selected[$item['target_id']] = $entities[$item['target_id']];
}
}
}
return $selected;
}