Index: trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
===================================================================
--- trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php (revision 32724)
+++ trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php (revision 32756)
@@ -337,13 +337,27 @@
/**
+ * @since 4.3.0
+ *
+ * @param WP_Theme $theme
+ */
+ public function column_cb( $theme ) {
+ $checkbox_id = 'checkbox_' . md5( $theme->get('Name') );
+ ?>
+
+
+ errors() )
+ if ( ! $theme->errors() ) {
$actions['enable'] = '' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '';
+ }
} else {
$actions['disable'] = '' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '';
}
- if ( current_user_can('edit_themes') )
+ if ( current_user_can('edit_themes') ) {
$actions['edit'] = '' . __('Edit') . '';
-
- if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) )
+ }
+
+ if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) {
$actions['delete'] = '' . __( 'Delete' ) . '';
-
+ }
/**
* Filter the action links displayed for each theme in the Multisite
@@ -421,15 +437,91 @@
$actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, $context );
+ echo $this->row_actions( $actions, true );
+ }
+
+ /**
+ * @since 4.3.0
+ *
+ * @global string $status
+ * @global array $totals
+ *
+ * @param WP_Theme $theme
+ */
+ public function column_description( $theme ) {
+ global $status, $totals;
+ if ( $theme->errors() ) {
+ $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
+ echo '
";
-
+ echo "" . $theme->display( 'Description' ) . "
+ ";
+
+ $stylesheet = $theme->get_stylesheet();
+ $theme_meta = array();
+
+ if ( $theme->get('Version') ) {
+ $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display('Version') );
+ }
+ $theme_meta[] = sprintf( __( 'By %s' ), $theme->display('Author') );
+
+ if ( $theme->get('ThemeURI') ) {
+ $theme_meta[] = '
' . __( 'Visit Theme Site' ) . '';
+ }
+ /**
+ * Filter the array of row meta for each theme in the Multisite themes
+ * list table.
+ *
+ * @since 3.1.0
+ *
+ * @param array $theme_meta An array of the theme's metadata,
+ * including the version, author, and
+ * theme URI.
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme WP_Theme object.
+ * @param string $status Status of the theme.
+ */
+ $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
+ echo implode( ' | ', $theme_meta );
+
+ echo '
';
+ }
+
+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Theme $theme
+ * @param string $column_name
+ */
+ public function column_default( $theme, $column_name ) {
+ $stylesheet = $theme->get_stylesheet();
+ /**
+ * Fires inside each custom column of the Multisite themes list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name Name of the column.
+ * @param string $stylesheet Directory name of the theme.
+ * @param WP_Theme $theme Current WP_Theme object.
+ */
+ do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
+ }
+
+ /**
+ * @since 4.3.0
+ *
+ * @param WP_Theme $item
+ */
+ public function single_row_columns( $item ) {
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
@@ -442,47 +534,24 @@
switch ( $column_name ) {
case 'cb':
- echo "$checkbox | ";
- break;
+ echo '';
+
+ $this->column_cb( $item );
+
+ echo ' | ';
+ break;
+
case 'name':
- echo "" . $theme->display('Name') . "";
- echo $this->row_actions($actions, true);
+ echo " | " . $item->display('Name') . "";
+
+ $this->column_name( $item );
+
echo " | ";
break;
+
case 'description':
echo "";
- if ( $theme->errors() ) {
- $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
- echo ' ' . $pre . $theme->errors()->get_error_message() . ' ';
- }
- echo "" . $theme->display( 'Description' ) . "
- ";
-
- $theme_meta = array();
-
- if ( $theme->get('Version') )
- $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display('Version') );
-
- $theme_meta[] = sprintf( __( 'By %s' ), $theme->display('Author') );
-
- if ( $theme->get('ThemeURI') )
- $theme_meta[] = ' ' . __( 'Visit Theme Site' ) . '';
-
- /**
- * Filter the array of row meta for each theme in the Multisite themes
- * list table.
- *
- * @since 3.1.0
- *
- * @param array $theme_meta An array of the theme's metadata,
- * including the version, author, and
- * theme URI.
- * @param string $stylesheet Directory name of the theme.
- * @param WP_Theme $theme WP_Theme object.
- * @param string $status Status of the theme.
- */
- $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
- echo implode( ' | ', $theme_meta );
-
- echo ' ';
+
+ $this->column_description( $item );
+
echo ' | ';
break;
@@ -491,18 +560,40 @@
echo "";
- /**
- * Fires inside each custom column of the Multisite themes list table.
- *
- * @since 3.1.0
- *
- * @param string $column_name Name of the column.
- * @param string $stylesheet Directory name of the theme.
- * @param WP_Theme $theme Current WP_Theme object.
- */
- do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
+ $this->column_default( $item, $column_name );
echo " | ";
- }
- }
+ break;
+ }
+ }
+ }
+
+ /**
+ * @global string $status
+ * @global array $totals
+ *
+ * @param WP_Theme $theme
+ */
+ public function single_row( $theme ) {
+ global $status, $totals;
+
+ if ( $this->is_site_themes ) {
+ $allowed = $theme->is_allowed( 'site', $this->site_id );
+ } else {
+ $allowed = $theme->is_allowed( 'network' );
+ }
+
+ $stylesheet = $theme->get_stylesheet();
+
+ $class = ! $allowed ? 'inactive' : 'active';
+
+ $id = sanitize_html_class( $theme->get_stylesheet() );
+
+ if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
+ $class .= ' update';
+ }
+
+ echo "