嗯,黄色来自
<tr class="unapproved">
这与通常的
WP_List_Table
介绍可能表明,这不是一种自动操作,而是逐字逐句地生成:
参见示例。single_row()
在里面wp-admin/includes/class-wp-comments-list-table.php
:
function single_row( $a_comment ) {
global $post, $comment;
$comment = $a_comment;
$the_comment_class = join( \' \', get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) );
$post = get_post( $comment->comment_post_ID );
$this->user_can = current_user_can( \'edit_comment\', $comment->comment_ID );
echo "<tr id=\'comment-$comment->comment_ID\' class=\'$the_comment_class\'>";
echo $this->single_row_columns( $comment );
echo "</tr>\\n";
}
它重写从继承的标准方法
wp-admin/includes/class-wp-list-table.php