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 ) )
|
||||
$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{$extra_class}'$style><strong>" . $theme->display('Name') . "</strong>";
|
||||
if ( $primary === $column_name ) {
|
||||
echo $this->row_actions($actions, true);
|
||||
}
|
||||
echo "<td class='theme-title column-primary'$style><strong>" . $theme->display('Name') . "</strong>";
|
||||
echo $this->row_actions($actions, true);
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
echo "<td class='column-description desc{$extra_class}'$style>";
|
||||
echo "<td class='column-description desc'$style>";
|
||||
if ( $theme->errors() ) {
|
||||
$pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
|
||||
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 '</div>';
|
||||
if ( $primary === $column_name ) {
|
||||
echo $this->row_actions($actions, true);
|
||||
}
|
||||
echo '</td>';
|
||||
break;
|
||||
|
||||
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.
|
||||
@ -510,9 +500,6 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
||||
*/
|
||||
do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
|
||||
|
||||
if ( $primary === $column_name ) {
|
||||
echo $this->row_actions($actions, true);
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
|
@ -581,8 +581,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
||||
|
||||
$extra_class = ' column-primary';
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
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>";
|
||||
break;
|
||||
case 'name':
|
||||
if ( $primary === $column_name || ! isset( $columns[ $primary ] ) ) {
|
||||
echo "<td class='plugin-title $extra_class'$style><strong>$plugin_name</strong>";
|
||||
echo $this->row_actions( $actions, true );
|
||||
} else {
|
||||
echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
|
||||
}
|
||||
echo "<td class='plugin-title column-primary'$style><strong>$plugin_name</strong>";
|
||||
echo $this->row_actions( $actions, true );
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
$classes = 'column-description desc';
|
||||
if ( $primary === $column_name ) {
|
||||
$classes .= " $extra_class";
|
||||
}
|
||||
|
||||
echo "<td class='$classes'$style>
|
||||
<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 );
|
||||
echo implode( ' | ', $plugin_meta );
|
||||
|
||||
if ( $primary === $column_name ) {
|
||||
echo $this->row_actions( $actions, true );
|
||||
}
|
||||
echo "</div></td>";
|
||||
break;
|
||||
default:
|
||||
$classes = "$column_name column-$column_name$class";
|
||||
if ( $primary === $column_name ) {
|
||||
$classes .= " $extra_class";
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
if ( $primary === $column_name ) {
|
||||
echo $this->row_actions( $actions, true );
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
@ -724,9 +706,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
* @since 4.3.0
|
||||
* @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() {
|
||||
return 'plugin';
|
||||
return 'name';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user