List tables:
Since the primary column is not going to be alterable for plugins and MS themes, we don't need to check in on it. see #25408. git-svn-id: https://develop.svn.wordpress.org/trunk@32723 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1a0773a4b4
commit
c296d882a8
@ -438,24 +438,17 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
if ( in_array( $column_name, $hidden ) )
|
if ( in_array( $column_name, $hidden ) )
|
||||||
$style = ' style="display:none;"';
|
$style = ' style="display:none;"';
|
||||||
|
|
||||||
$extra_class = '';
|
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
$extra_class = ' column-primary';
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ( $column_name ) {
|
switch ( $column_name ) {
|
||||||
case 'cb':
|
case 'cb':
|
||||||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||||
break;
|
break;
|
||||||
case 'name':
|
case 'name':
|
||||||
echo "<td class='theme-title{$extra_class}'$style><strong>" . $theme->display('Name') . "</strong>";
|
echo "<td class='theme-title column-primary'$style><strong>" . $theme->display('Name') . "</strong>";
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
echo $this->row_actions($actions, true);
|
echo $this->row_actions($actions, true);
|
||||||
}
|
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
break;
|
break;
|
||||||
case 'description':
|
case 'description':
|
||||||
echo "<td class='column-description desc{$extra_class}'$style>";
|
echo "<td class='column-description desc'$style>";
|
||||||
if ( $theme->errors() ) {
|
if ( $theme->errors() ) {
|
||||||
$pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
|
$pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
|
||||||
echo '<p><strong class="attention">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
|
echo '<p><strong class="attention">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
|
||||||
@ -490,14 +483,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
echo implode( ' | ', $theme_meta );
|
echo implode( ' | ', $theme_meta );
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
echo $this->row_actions($actions, true);
|
|
||||||
}
|
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo "<td class='$column_name column-$column_name{$extra_class}'$style>";
|
echo "<td class='$column_name column-$column_name'$style>";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires inside each custom column of the Multisite themes list table.
|
* Fires inside each custom column of the Multisite themes list table.
|
||||||
@ -510,9 +500,6 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
*/
|
*/
|
||||||
do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
|
do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
|
||||||
|
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
echo $this->row_actions($actions, true);
|
|
||||||
}
|
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -581,8 +581,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
|
|
||||||
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
||||||
|
|
||||||
$extra_class = ' column-primary';
|
|
||||||
|
|
||||||
foreach ( $columns as $column_name => $column_display_name ) {
|
foreach ( $columns as $column_name => $column_display_name ) {
|
||||||
$style = '';
|
$style = '';
|
||||||
if ( in_array( $column_name, $hidden ) ) {
|
if ( in_array( $column_name, $hidden ) ) {
|
||||||
@ -594,19 +592,12 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||||
break;
|
break;
|
||||||
case 'name':
|
case 'name':
|
||||||
if ( $primary === $column_name || ! isset( $columns[ $primary ] ) ) {
|
echo "<td class='plugin-title column-primary'$style><strong>$plugin_name</strong>";
|
||||||
echo "<td class='plugin-title $extra_class'$style><strong>$plugin_name</strong>";
|
|
||||||
echo $this->row_actions( $actions, true );
|
echo $this->row_actions( $actions, true );
|
||||||
} else {
|
|
||||||
echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
|
|
||||||
}
|
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
break;
|
break;
|
||||||
case 'description':
|
case 'description':
|
||||||
$classes = 'column-description desc';
|
$classes = 'column-description desc';
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
$classes .= " $extra_class";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<td class='$classes'$style>
|
echo "<td class='$classes'$style>
|
||||||
<div class='plugin-description'>$description</div>
|
<div class='plugin-description'>$description</div>
|
||||||
@ -655,16 +646,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
|
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
|
||||||
echo implode( ' | ', $plugin_meta );
|
echo implode( ' | ', $plugin_meta );
|
||||||
|
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
echo $this->row_actions( $actions, true );
|
|
||||||
}
|
|
||||||
echo "</div></td>";
|
echo "</div></td>";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$classes = "$column_name column-$column_name$class";
|
$classes = "$column_name column-$column_name$class";
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
$classes .= " $extra_class";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<td class='$classes'$style>";
|
echo "<td class='$classes'$style>";
|
||||||
|
|
||||||
@ -679,9 +664,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
*/
|
*/
|
||||||
do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
|
do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
|
||||||
|
|
||||||
if ( $primary === $column_name ) {
|
|
||||||
echo $this->row_actions( $actions, true );
|
|
||||||
}
|
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -724,9 +706,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
* @since 4.3.0
|
* @since 4.3.0
|
||||||
* @access protected
|
* @access protected
|
||||||
*
|
*
|
||||||
* @return string Unalterable name for the primary column, in this case, 'plugin'.
|
* @return string Unalterable name for the primary column, in this case, 'name'.
|
||||||
*/
|
*/
|
||||||
protected function get_primary_column_name() {
|
protected function get_primary_column_name() {
|
||||||
return 'plugin';
|
return 'name';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user