mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31181 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -288,7 +288,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
protected function get_table_classes() {
|
||||
return array( 'widefat', 'fixed', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
|
||||
return array( 'widefat', 'fixed', 'striped', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
|
||||
}
|
||||
|
||||
public function get_columns() {
|
||||
@@ -572,13 +572,11 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
|
||||
/**
|
||||
* @global string $mode
|
||||
* @staticvar string $alternate
|
||||
* @param WP_Post $post
|
||||
* @param int $level
|
||||
*/
|
||||
public function single_row( $post, $level = 0 ) {
|
||||
global $mode;
|
||||
static $alternate;
|
||||
|
||||
$global_post = get_post();
|
||||
$GLOBALS['post'] = $post;
|
||||
@@ -589,8 +587,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
$post_type_object = get_post_type_object( $post->post_type );
|
||||
$can_edit_post = current_user_can( 'edit_post', $post->ID );
|
||||
|
||||
$alternate = 'alternate' == $alternate ? '' : 'alternate';
|
||||
$classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
|
||||
$classes = 'iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
|
||||
|
||||
$lock_holder = wp_check_post_lock( $post->ID );
|
||||
if ( $lock_holder ) {
|
||||
|
||||
Reference in New Issue
Block a user