protected function getGuidsToPreload(array $items)
{
$guids = array();
foreach ($items as $item) {
// TODO remove duplication of @link likes_river_menu_setup()
if ($item instanceof \ElggRiverItem) {
// only like group creation #3958
if ($item->type == "group" && $item->view != "river/group/create") {
continue;
}
$type = $item->type;
$subtype = $item->subtype;
$likable = (bool) elgg_trigger_plugin_hook('likes:is_likable', "{$type}:{$subtype}", [], false);
if (!$likable) {
continue;
}
if ($item->annotation_id != 0) {
continue;
}
if ($item->object_guid) {
$guids[$item->object_guid] = true;
}
} elseif ($item instanceof \ElggEntity) {
$type = $item->type;
$subtype = $item->getSubtype();
$likable = (bool) elgg_trigger_plugin_hook('likes:is_likable', "{$type}:{$subtype}", [], false);
if ($likable) {
$guids[$item->guid] = true;
}
}
}
return array_keys($guids);
}