Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
1  
I have trouble following how row actions (controls) connect to row presentation (styling) in your question? –  Rarst Jun 1 '13 at 12:36
add comment

1 Answer

up vote 0 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
add comment

Your Answer

 
discard

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.