Carbon_Fields\Field\Relationship_Field::get_item_label PHP Method

get_item_label() public method

Can be overriden or extended by the carbon_relationship_item_label filter.
public get_item_label ( integer $id, string $type, string $subtype = '' ) : string
$id integer The database ID of the item.
$type string Item type (post, term, user, comment, or a custom one).
$subtype string Subtype - "page", "post", "category", etc.
return string $label The label of the item.
    public function get_item_label($id, $type, $subtype = '')
    {
        $object = get_post_type_object($subtype);
        $label = $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);
    }