Carbon_Fields\Field\Association_Field::item_template PHP Method

item_template() public method

Used for both the selected and the selectable options.
public item_template ( boolean $display_input = true )
$display_input boolean Whether to display the selected item input field.
    public function item_template($display_input = true)
    {
        ?>
		<li>
			<span class="mobile-handle dashicons-before dashicons-menu"></span>
			<a href="#" data-item-id="{{{ item.id }}}" data-item-title="{{{ item.title }}}" data-item-type="{{{ item.type }}}" data-item-subtype="{{{ item.subtype }}}" data-item-label="{{{ item.label }}}" data-value="{{{ item.type }}}:{{{ item.subtype }}}:{{{ item.id }}}">
				<# if ( item.edit_link ) { #>
					<em class="edit-link dashicons-before dashicons-edit" data-href="{{{ item.edit_link }}}"><?php 
        _e('Edit', 'carbon-fields');
        ?>
</em>
				<# } #>
				<em>{{{ item.label }}}</em>
				<span class="dashicons-before dashicons-plus-alt"></span>
				{{{ item.title }}}
				<# if (item.is_trashed) { #>
					<i class="trashed dashicons-before dashicons-trash"></i>
				<# } #>
			</a>
			<?php 
        if ($display_input) {
            ?>
				<input type="hidden" name="{{{ name }}}[]" value="{{{ item.type }}}:{{{ item.subtype }}}:{{{ item.id }}}" />
			<?php 
        }
        ?>
		</li>
		<?php 
    }