function LinkitPluginTaxonomy_Term::buildGroup in Linkit 7.2
When "group_by_bundle" is active, we need to add the bundle name to the group, else just return the entity label.
Return value
a string with the group name.
Overrides LinkitPluginEntity::buildGroup
File
- plugins/
linkit_plugins/ linkit-plugin-taxonomy_term.class.php, line 23 - Define Linkit term plugin class.
Class
- LinkitPluginTaxonomy_Term
- @file Define Linkit term plugin class.
Code
function buildGroup($entity) {
// Get the entity label.
$group = $this->entity_info['label'];
if (isset($this->conf['group_by_bundle']) && $this->conf['group_by_bundle']) {
$bundles = $this->entity_info['bundles'];
$bundle_name = $bundles[$entity->vocabulary_machine_name]['label'];
$group .= ' · ' . check_plain($bundle_name);
}
return $group;
}