Admin Column for a Taxonomy Added by a Plugin or Theme
Shows a column for any taxonomy in its post type's admin list, even when the plugin or theme that registered it left the column out.
Opens WPIDE on
Code
// Taxonomies that should get an admin column.
$wpide_tax_columns = array( 'portfolio_category', 'product_brand' );
add_filter( 'register_taxonomy_args', function ( $args, $taxonomy ) use ( $wpide_tax_columns ) {
if ( in_array( $taxonomy, $wpide_tax_columns, true ) ) {
$args['show_admin_column'] = true;
}
return $args;
}, 10, 2 );
Notes
List taxonomy names (shown in the URL when you edit its terms, e.g. taxonomy=portfolio_category).
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.