WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/manage $taxonomy id columns

Description

Applied to the list of columns to print on the manage screen for a taxonomy. Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column.

See also the action manage_edit-post_type_columns, which alters the column information for a post type table.

Examples

Add Columns

Suppose you want to add a column to the 'category' taxonomy that shows the taxonomy term ID.

function my_custom_taxonomy_columns( $columns )
{
	$columns['my_term_id'] = __('Term ID');

	return $columns;
}
add_filter('manage_edit-category_columns' , 'my_custom_taxonomy_columns');

Note the pattern: manage_edit-{taxonomy}_columns

Add Content to a Column

To add content to each row (term) for the new column, we need to implement

function my_custom_taxonomy_columns_content( $content, $column_name, $term_id )
{
    if ( 'my_term_id' == $column_name ) {
        $content = $term_id;
    }
	return $content;
}
add_filter( 'manage_category_custom_column', 'my_custom_taxonomy_columns_content', 10, 3 );

Note the pattern: manage_{taxonomy}_custom_column