WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In this Example, let's assume every item had the attribute $item['approved'] with values Zero unapproved and One for approved.

How can I get the rows of the "unapproved books" to be yellow?

(well, it's not about the yellow, but about the WP standard compliant procedure of marking rows as unapproved)

share|improve this question
I have trouble following how row actions (controls) connect to row presentation (styling) in your question? – Rarst Jun 1 '13 at 12:36
up vote 1 down vote accepted

Well, the yellow comes from

<tr class="unapproved">

and this is, in crass contrast to what the usual WP_List_Table introduction might suggest, not an automatism, but generated very verbatim:

See e.g. single_row() in 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";

which overrides the standard method inherited from wp-admin/includes/class-wp-list-table.php

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.