List tables: Use a class instead of inline styles for hidden columns.
fixes #32608. Built from https://develop.svn.wordpress.org/trunk@32724 git-svn-id: http://core.svn.wordpress.org/trunk@32694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
06ebd0a2aa
commit
c87224eaf6
|
@ -181,12 +181,11 @@ class WP_Links_List_Table extends WP_List_Table {
|
|||
$classes .= ' has-row-actions column-primary';
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ) {
|
||||
?>
|
||||
|
|
|
@ -946,11 +946,9 @@ class WP_List_Table {
|
|||
foreach ( $columns as $column_key => $column_display_name ) {
|
||||
$class = array( 'manage-column', "column-$column_key" );
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_key, $hidden ) )
|
||||
$style = 'display:none;';
|
||||
|
||||
$style = ' style="' . $style . '"';
|
||||
if ( in_array( $column_key, $hidden ) ) {
|
||||
$class[] = 'hidden';
|
||||
}
|
||||
|
||||
if ( 'cb' == $column_key )
|
||||
$class[] = 'check-column';
|
||||
|
@ -978,7 +976,7 @@ class WP_List_Table {
|
|||
if ( !empty( $class ) )
|
||||
$class = "class='" . join( ' ', $class ) . "'";
|
||||
|
||||
echo "<th scope='col' $id $class $style>$column_display_name</th>";
|
||||
echo "<th scope='col' $id $class>$column_display_name</th>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1137,12 +1135,11 @@ class WP_List_Table {
|
|||
$classes .= ' has-row-actions column-primary';
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' == $column_name ) {
|
||||
echo '<th scope="row" class="check-column">';
|
||||
|
|
|
@ -340,12 +340,11 @@ foreach ( $columns as $column_name => $column_display_name ) {
|
|||
$classes .= ' has-row-actions column-primary';
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ) {
|
||||
?>
|
||||
|
|
|
@ -272,12 +272,11 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
|
|||
$classes .= ' has-row-actions column-primary';
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ) {
|
||||
?>
|
||||
|
|
|
@ -434,21 +434,22 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
$extra_classes = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$extra_classes .= ' hidden';
|
||||
}
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb':
|
||||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||
break;
|
||||
case 'name':
|
||||
echo "<td class='theme-title column-primary'$style><strong>" . $theme->display('Name') . "</strong>";
|
||||
echo "<td class='theme-title column-primary{$extra_classes}'><strong>" . $theme->display('Name') . "</strong>";
|
||||
echo $this->row_actions($actions, true);
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
echo "<td class='column-description desc'$style>";
|
||||
echo "<td class='column-description desc{$extra_classes}'>";
|
||||
if ( $theme->errors() ) {
|
||||
$pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
|
||||
echo '<p><strong class="attention">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
|
||||
|
@ -487,7 +488,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||
break;
|
||||
|
||||
default:
|
||||
echo "<td class='$column_name column-$column_name'$style>";
|
||||
echo "<td class='$column_name column-$column_name{$extra_classes}'>";
|
||||
|
||||
/**
|
||||
* Fires inside each custom column of the Multisite themes list table.
|
||||
|
|
|
@ -208,12 +208,11 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||
$classes .= ' column-primary';
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ){
|
||||
?>
|
||||
|
|
|
@ -582,9 +582,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
$extra_classes = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$extra_classes = ' hidden';
|
||||
}
|
||||
|
||||
switch ( $column_name ) {
|
||||
|
@ -592,14 +592,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||
break;
|
||||
case 'name':
|
||||
echo "<td class='plugin-title column-primary'$style><strong>$plugin_name</strong>";
|
||||
echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>";
|
||||
echo $this->row_actions( $actions, true );
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
$classes = 'column-description desc';
|
||||
|
||||
echo "<td class='$classes'$style>
|
||||
echo "<td class='$classes{$extra_classes}'>
|
||||
<div class='plugin-description'>$description</div>
|
||||
<div class='$class second plugin-version-author-uri'>";
|
||||
|
||||
|
@ -651,7 +651,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||
default:
|
||||
$classes = "$column_name column-$column_name$class";
|
||||
|
||||
echo "<td class='$classes'$style>";
|
||||
echo "<td class='$classes{$extra_classes}'>";
|
||||
|
||||
/**
|
||||
* Fires inside each custom column of the Plugins list table.
|
||||
|
|
|
@ -722,12 +722,11 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
$classes .= ' page-title'; // Special addition for title column
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ) {
|
||||
?>
|
||||
|
|
|
@ -415,12 +415,11 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||
$classes .= ' num'; // Special case for that column
|
||||
}
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) ) {
|
||||
$style = ' style="display:none;"';
|
||||
$classes .= ' hidden';
|
||||
}
|
||||
|
||||
$attributes = "class='$classes'$style";
|
||||
$attributes = "class='$classes'";
|
||||
|
||||
if ( 'cb' === $column_name ) {
|
||||
$r .= "<th scope='row' class='check-column'>$checkbox</th>";
|
||||
|
|
|
@ -37,12 +37,12 @@ columns = {
|
|||
},
|
||||
|
||||
checked : function(column) {
|
||||
$('.column-' + column).show();
|
||||
$('.column-' + column).removeClass( 'hidden' );
|
||||
this.colSpanChange(+1);
|
||||
},
|
||||
|
||||
unchecked : function(column) {
|
||||
$('.column-' + column).hide();
|
||||
$('.column-' + column).addClass( 'hidden' );
|
||||
this.colSpanChange(-1);
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-alpha-32723';
|
||||
$wp_version = '4.3-alpha-32724';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue