List tables: tighten up primary column handling for plugins and multisite themes.

These shouldn't be able to have their primary column reassigned by default. Also removes the `has-row-actions` class as these list tables always have row actions visible and the JS for visual toggling conflicts. The `column-primary` class remains.

props stephdau.
see #25408.

Built from https://develop.svn.wordpress.org/trunk@32686


git-svn-id: http://core.svn.wordpress.org/trunk@32656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2015-06-03 15:08:28 +00:00
parent 2c9a2850b4
commit 2d3a637598
3 changed files with 16 additions and 11 deletions

View File

@ -245,14 +245,14 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
}
/**
* Get the name of the default primary column.
* Get the name of the primary column.
*
* @since 4.3.0
* @access protected
*
* @return string Name of the default primary column name, in this case, 'name'.
* @return string Unalterable name of the primary column name, in this case, 'name'.
*/
protected function get_default_primary_column_name() {
protected function get_primary_column_name() {
return 'name';
}
@ -438,19 +438,24 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
if ( in_array( $column_name, $hidden ) )
$style = ' style="display:none;"';
$extra_class = '';
if ( $primary === $column_name ) {
$extra_class = ' column-primary';
}
switch ( $column_name ) {
case 'cb':
echo "<th scope='row' class='check-column'>$checkbox</th>";
break;
case 'name':
echo "<td class='theme-title'$style><strong>" . $theme->display('Name') . "</strong>";
echo "<td class='theme-title{$extra_class}'$style><strong>" . $theme->display('Name') . "</strong>";
if ( $primary === $column_name ) {
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_class}'$style>";
if ( $theme->errors() ) {
$pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
echo '<p><strong class="attention">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
@ -492,7 +497,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_class}'$style>";
/**
* Fires inside each custom column of the Multisite themes list table.

View File

@ -581,7 +581,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
$extra_class = ' has-row-actions column-primary';
$extra_class = ' column-primary';
foreach ( $columns as $column_name => $column_display_name ) {
$style = '';
@ -719,14 +719,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
}
/**
* Get the name of default primary column for this specific list table.
* Get the name of primary column for this specific list table.
*
* @since 4.3.0
* @access protected
*
* @return string Name for the default primary column, in this case, 'plugin'.
* @return string Unalterable name for the primary column, in this case, 'plugin'.
*/
protected function get_default_primary_column_name() {
protected function get_primary_column_name() {
return 'plugin';
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32685';
$wp_version = '4.3-alpha-32686';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.