ダッシュボードに「コメントの書き出し」を表示する方法
-
プラグイン「BBPress」で作った掲示板があり、そのコメントの一覧をダッシュボードから見ることができます。
今回はこのダッシュボードに「コメントの書き出し」を表示させたいのですが、どうしたらよろしいでしょうか。
たとえば通常の投稿ならば、ご存知のように下記コードで大丈夫です。
function add_posts_columns_contentword($columns) { $columns['contentword'] = '本文の書き出し'; return $columns; } function add_posts_columns_contentword_row($column_name, $post_id) { if( 'contentword' == $column_name ) { $contentword = get_post_field('post_content', $post_id); $contentword = str_replace( array("\r\n","\r","\n"), '', $contentword) ; $contentword = mb_substr($contentword,0,16); echo $contentword; } } add_filter( 'manage_posts_columns', 'add_posts_columns_contentword' ); add_action( 'manage_posts_custom_column', 'add_posts_columns_contentword_row', 10, 2 );
これを書けば、ダッシュボードの投稿一覧に「本文の書き出し」が出力できます。
これと同様に、ダッシュボードのコメント一覧にも「コメントの書き出し」を出力したいと考えています。
お詳しい方、どうぞ宜しくお願い致します。
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「ダッシュボードに「コメントの書き出し」を表示する方法」には新たに返信することはできません。