I want to add the categories ID to admin page.
I call it for my functions.php
: require_once('includes/categories_custom_id.php');
The part of code:
function categoriesColumnsHeader($columns) {
$columns['catID'] = __('ID');
return $columns;
}
add_filter( 'manage_categories_columns', 'categoriesColumnsHeader' );
function categoriesColumnsRow($argument, $columnName, $categoryID){
if($columnName == 'catID'){
return $categoryID;
}
}
add_filter( 'manage_categories_custom_column', 'categoriesColumnsRow', 10, 3 );
But it doesn’t work. Any idea, how to do that?
Thanks in advance.
The hooks for taxonomies are:
"manage_edit-${taxonomy}_columns"
for the header"manage_edit-${taxonomy}_sortable_columns"
to make columns sortable"manage_${taxonomy}_custom_column"
for the cell contentTo catch all taxonomies write:
You had it almost all right, but the hook names, where did you get those from?
The following are the correct ones. I’m adding two extra functions, one will add our column as the first one (instead of being the last, I guess it makes more sense for an ID column). And the second is a simple CSS fix for the column width.
Code based in this Q&A: Multisite – Protect categories from deletion?
Result: