Well, maybe you can use this to get started….. I use this for my custom post type (ve_products) and to display my custom taxonomy (product_category)
// ADDS EXTRA INFO TO ADMIN MENU FOR PRODUCT POST TYPE
add_filter("manage_edit-ve_products_columns", "voodoo_prod_edit_columns");
add_action("manage_posts_custom_column", "voodoo_prod_custom_columns");
function voodoo_prod_edit_columns( $columns ) {
// Add the extra column for product categories instead of rebuilding the whole array
$columns['prod_cat'] = "Product Category";
return $columns;
}
function voodoo_prod_custom_columns( $column ) {
global $post;
switch( $column ) {
case "description":
the_excerpt();
break;
case "prod_cat":
echo get_the_term_list( $post->ID, 'product_category', '', ', ', '' );
break;
}
}
Thread Starter
dskbrk
(@dskbrk)
hey Rev. Voodoo,
this is a great start! your snippet works very well.
Now I’m going to look if there are also any hooks for the filter funcionalities (ex: show only posts with that term…).
Thank you so much.
Glad I could at least get you started!!
Thread Starter
dskbrk
(@dskbrk)
well, I found that adding the custom taxonomy in the edit panel url (&customtax=term) WordPress actually filter the results, so for adding filter functionalities, in the snippet above for example, is as simple as that:
function voodoo_prod_custom_columns( $column ) {
global $post;
switch( $column ) {
case "customtaxonomy":
$terms = get_the_terms( $post->ID, 'customtaxonomy');
if ($terms) {
foreach ($terms as $term => $myterm) {
echo '<a href="'.get_bloginfo('url').'/wp-admin/edit.php?post_type=customtype&customtaxonomy='.$myterm->slug.'">'.$myterm->slug.'</a>';
}
}
break;
//etc...
}
}
now links filter posts by the custom taxonomy term 🙂