public function get_item_label($id, $type, $subtype = '')
{
$label = $subtype ? $subtype : $type;
if ($type === 'post') {
$post_type_object = get_post_type_object($subtype);
$label = $post_type_object->labels->singular_name;
} elseif ($type === 'term') {
$taxonomy_object = get_taxonomy($subtype);
$label = $taxonomy_object->labels->singular_name;
}
/**
* Filter the label of the relationship item.
*
* @param string $label The unfiltered item label.
* @param string $name Name of the relationship field.
* @param int $id The database ID of the item.
* @param string $type Item type (post, term, user, comment, or a custom one).
* @param string $subtype Subtype - "page", "post", "category", etc.
*/
return apply_filters('carbon_relationship_item_label', $label, $this->get_name(), $id, $type, $subtype);
}