Help us understand the problem. What is going on with this article?

Wordpress で管理画面にカテゴリIDを表示

More than 5 years have passed since last update.

検索してみたら『URLのパラメータを調べろ』ばっかりだったのでメモ。

functions.php に

<?php
function add_category_columns($columns)
{
    $index = 1; // 追加位置

    return array_merge(
        array_slice($columns, 0, $index),
        array('id' => 'ID'),
        array_slice($columns, $index)
    );
}
add_filter('manage_edit-category_columns', 'add_category_columns');

function add_category_custom_fields($deprecated, $column_name, $term_id)
{
    if ($column_name == 'id') {
        echo $term_id;
    }
}
add_action('manage_category_custom_column', 'add_category_custom_fields', 10, 3);

て書いておくと編集画面がこんな感じになります。

categories.png

他の場所に出す時はフィルタ/アクション名を調べて追記すれば良し。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away