Exemple #1
0
/**
 * Create callbacks for custom columns.
 *
 * @since Quality Control 0.1
 * @uses get_the_term_list
 */
function quality_manage_columns($column)
{
    global $post;
    switch ($column) {
        case 'milestone':
            $milestones = get_the_terms($post->ID, 'ticket_milestone');
            if (!empty($milestones)) {
                $out = array();
                foreach ($milestones as $c) {
                    $out[] = "<a href='edit.php?post_type={$post->post_type}&amp;ticket_milestone={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'ticket_milestone', 'display')) . "</a>";
                }
                echo join(', ', $out);
            } else {
                _e('No Milestone', 'quality');
            }
            break;
        case 'status':
            $states = get_the_terms($post->ID, 'ticket_status');
            if (!empty($states)) {
                $out = array();
                foreach ($states as $c) {
                    $out[] = "<a href='edit.php?post_type={$post->post_type}&amp;ticket_status={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'ticket_milestone', 'display')) . "</a>";
                }
                echo join(', ', $out);
            } else {
                _e('No Status', 'quality');
            }
            break;
        case 'assigned':
            echo quality_assigned_to_list();
            break;
    }
}
}
?>

<li>
	<small><?php 
_e('Created by', 'quality');
?>
</small>
	<?php 
the_author_posts_link();
?>
</li>

<?php 
if (quality_assigned_to()) {
    ?>
<li>
	<small><?php 
    _e('Assigned to', 'quality');
    ?>
</small>
	<?php 
    quality_assigned_to_list();
    ?>
</li>
<?php 
}
?>

<?php 
do_action('quality_ticket_meta_after');