Make WordPress Core


Ignore:
Timestamp:
01/14/2015 10:13:03 PM (10 years ago)
Author:
helen
Message:

List tables: Use CSS :nth-child() selectors for zebra striping.

Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the .alternate class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r30679 r31181  
    150150        global $mode;
    151151
    152         $alt = '';
    153152        $super_admins = get_super_admins();
    154153        foreach ( $this->items as $user ) {
    155             $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
     154            $class = '';
    156155
    157156            $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
     
    159158            foreach ( $status_list as $status => $col ) {
    160159                if ( $user->$status )
    161                     $alt .= " $col";
     160                    $class .= " $col";
    162161            }
    163162
    164163            ?>
    165             <tr class="<?php echo $alt; ?>">
     164            <tr class="<?php echo trim( $class ); ?>">
    166165            <?php
    167166
Note: See TracChangeset for help on using the changeset viewer.