Excellent.
The same function that added the post tag can simply be modified like so to add category support:
$defaults['post_type']['args']['taxonomies'] = array( 'post_tag', 'category' );
I never considered admin column customization when I was originally coding my plugin, and admin columns are one of the few areas in which I didn’t place any filters for easier customization by users. I’m currently in the process of making some significant structural improvements to the plugin, and addressing this is on my list.
If you wanted to try to do it anyway, you would have to add a function (wherever you put the code to add post_tag
support would be a suitable location) that would redefine all the columns while adding tags and categories columns as well. Then you’d have to hook on and provide the values for those columns as well.
For the column definition part:
add_filter( 'manage_portfolio_posts_columns', 'custom_portfolio_admin_columns', 11 );
function custom_portfolio_admin_columns( $columns ) {
$columns = array(
'cb' => '<input type="checkbox" />',
'portfolio_thumbnail' => __( 'Image', 'acp' ),
'title' => __( 'Title', 'acp' ),
'portfolio_description' => __( 'Description', 'acp' ),
'portfolio_features' => __( 'Features', 'acp' ),
'portfolio_link' => __( 'Link Type', 'acp' ),
'tags' => __( 'Tags', 'acp' ),
'categories' => __( 'Categories', 'acp' ),
'date' => __( 'Date', 'acp' )
);
return $columns;
}
For the values:
add_action( 'manage_posts_custom_column', 'custom_column_values', 11 );
function columns_data( $column ) {
global $post;
if( 'portfolio' != get_post_type() ) return;
switch( $column ) {
case 'tags' :
echo get_the_term_list( $post->ID, 'post_tag', '', ', ', '' );
break;
case 'categories':
echo get_the_term_list( $post->ID, 'category', '', ', ', '' );
break;
}
}
I haven’t tested any of that code, but it should be fairly close.
Alternatively you avoid all of that and when I release 1.4.0 the columns will show up automatically for builtin and any custom taxonomies (as long as the custom taxonomies has 'show_admin_column' => true,
set for registration).