I use the following in my filter hook manage_edit-<post-type>_columns
add_filter( 'manage_edit-visitor_columns', array( &$this, '_wp_filter_visitor_columns' ) );
public function _wp_filter_visitor_columns( $columns )
{
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => 'Name',
'type' => 'Type',
//'state' => 'Current State',
'id' => 'Visitor ID',
'acct' => 'Using Account',
);
return $columns;
}
And to filter the column view, I use the following:
add_action( 'manage_posts_custom_column', array( &$this, '_wp_filter_visitor_column_view' ) );
public function _wp_filter_visitor_column_view( $column )
{
global $post;
if ( $column == "type" )
{
//$terms = get_the_term_list( $post->ID, 'v_types', '', ', ', '' );
//echo strip_tags( $terms );
$terms = wp_get_object_terms( $post->ID, 'v_types' );
echo $terms[0]->name;
}
elseif ( $column == "state" OR $column == "workstation" )
{
$workstation = get_post_meta( $post->ID, 'v_workstation', true );
if ( $column == "workstation" ) echo $workstation;
elseif ( $column == "state" ) echo 'Not coded....';
}
elseif ( $column == "id" )
{
echo get_post_meta( $post->ID, 'v_id', true );
}
elseif ( $column == "acct" )
{
$terms = wp_get_object_terms( $post->ID, 'v_accounts' );
echo $terms[0]->name;
}
}
I hope this helps you.