Title: コメント編集へカスタムフィールドを表示させたい
Last modified: 2021年10月1日

---

# コメント編集へカスタムフィールドを表示させたい

 *  解決済 [non888](https://ja.wordpress.org/support/users/non888/)
 * (@non888)
 * [5年、 1ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e7%b7%a8%e9%9b%86%e3%81%b8%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%81%9f/)
 * 管理画面のコメント編集欄に自作のカスタムフィールド欄を表示させたく思っております。
   
   管理画面のコメント一覧は下記コードで実装できました。
 *     ```
       //管理画面のコメント一覧に追加項目を表示
       function manage_comment_columns($columns) {
         $columns['post_create_user'] = "投稿作成者";
         return $columns;
       }
       //管理画面のコメント一覧でカスタムフィールドの値を表示
       function add_comment_columns($column_name, $comment_id) {
         if( $column_name == 'post_create_user' ) {
             $review_1 = get_comment_meta( $comment_id, 'post_create_user', true );
             echo attribute_escape($review_1);
         }
       }
       add_filter( 'manage_edit-comments_columns', 'manage_comment_columns' );
       add_action( 'manage_comments_custom_column', 'add_comment_columns',null, 2);
       ```
   
 * 調べたところ下記の記事を見つけたのですが、「wp-admin/edit-form-comment.php」を
   直接編集する方法となっているのですが、これ以外でこれといった情報がなく、この方法
   でしか対応が難しいのでしょうか？
 * [参考サイト](https://al-batross.net/2021/03/31/wordpress-cutomize-admin-comment-form/)
 * 何か良い方法をご存じでしたらお教えいただけますでしょうか。
    よろしくお願いいた
   します。

2件の返信を表示中 - 1 - 2件目 (全2件中)

 *  [ishitaka](https://ja.wordpress.org/support/users/ishitaka/)
 * (@ishitaka)
 * [5年、 1ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e7%b7%a8%e9%9b%86%e3%81%b8%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%81%9f/#post-11675075)
 * こんにちは
 * [add_meta_boxes_comment](https://developer.wordpress.org/reference/hooks/add_meta_boxes_comment/)
   フックあたり（コメント欄の下）で追加するのはどうでしょうか。
    下記ページが参考
   になると思います。 [https://stackoverflow.com/questions/24417651/how-to-display-comments-meta-fields-value-in-admin-comment-section](https://stackoverflow.com/questions/24417651/how-to-display-comments-meta-fields-value-in-admin-comment-section)
 *  トピック投稿者 [non888](https://ja.wordpress.org/support/users/non888/)
 * (@non888)
 * [5年、 1ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e7%b7%a8%e9%9b%86%e3%81%b8%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%81%9f/#post-11675078)
 * [@ishitaka](https://ja.wordpress.org/support/users/ishitaka/) 様
    ありがとうご
   ざいます。 お教えいただきましたフックと記事をもとに実装ができました！

2件の返信を表示中 - 1 - 2件目 (全2件中)

 トピック「コメント編集へカスタムフィールドを表示させたい」には新たに返信すること
はできません。

## タグ

 * [カスタムフィールド](https://ja.wordpress.org/support/topic-tag/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89/)
 * [コメント](https://ja.wordpress.org/support/topic-tag/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88/)

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2件の返信
 * 2人の参加者
 * 最後の返信者: [non888](https://ja.wordpress.org/support/users/non888/)
 * 最後の活動: [5年、 1ヶ月前](https://ja.wordpress.org/support/topic/%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e7%b7%a8%e9%9b%86%e3%81%b8%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%81%9f/#post-11675078)
 * 状態: 解決済

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
