I am trying to add a column in admin table listing of my custom post type cota
that is the current taxonomy tipo
but it's not printing it.
Here's the current code:
function la_set_cota_columns($columns){
$newColumns = array();
$newColumns['title'] = 'Título da Cota';
$newColumns['comissao'] = 'Comissão';
$newColumns['proprietario'] = 'Proprietário';
$newColumns['vencimento'] = 'Vencimento';
$newColumns['tipo'] = 'Tipo de Cota';
return $newColumns;
}
add_filter('manage_cota_posts_columns', 'la_set_cota_columns');
function la_cota_custom_column($column, $post_id){
$content = get_post_meta($post_id);
switch( $column ){
case 'comissao' :
echo $content['comissao'][0];
break;
case 'proprietario' :
echo $content['proprietario'][0];
break;
case 'vencimento' :
echo $content['vencimento'][0];
break;
case 'tipo':
echo get_metadata('cota', $post_id, 'tipo', $single = true);
break;
}
}
add_action('manage_cota_posts_custom_column', 'la_cota_custom_column', 10, 2);
Actual results can be found here
Thanks a lot in advance.