Skip to content

Instantly share code, notes, and snippets.

@jeremyjaymes
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyjaymes/3e418a883c94360d21ec to your computer and use it in GitHub Desktop.
Save jeremyjaymes/3e418a883c94360d21ec to your computer and use it in GitHub Desktop.
Custom "Tax ID" Column for WordPress Admin Columns
//* Show the taxonomy ID
add_filter( "manage_edit-my_tax_columns", 'my_add_col' );
add_filter( "manage_edit-my_tax_sortable_columns", 'my_add_col' );
add_filter( "manage_my_tax_custom_column", 'my_tax_id', 10, 3 );
function my_add_col( $new_columns ) {
$new_columns = array(
'cb' => '<input type="checkbox" />',
'name' => __('Name'),
'slug' => __('Slug'),
'posts' => __('Posts'),
'tax_id' => 'ID'
);
return $new_columns;
}
function my_tax_id( $value, $name, $id ) {
return 'tax_id' === $name ? $id : $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment