diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index a6ddfdaa8d..47c2fc90b9 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -250,79 +250,102 @@ class WP_MS_Themes_List_Table extends WP_List_Table { } function display_rows() { + foreach ( $this->items as $key => $theme ) + $this->single_row( $key, $theme ); + } + + function single_row( $key, $theme ) { global $status, $page, $s; $context = $status; - + if ( $this->is_site_themes ) $url = "site-themes.php?id={$this->site_id}&"; else $url = 'themes.php?'; - foreach ( $this->items as $key => $theme ) { - // preorder - $actions = array( - 'enable' => '', - 'disable' => '', - 'edit' => '' - ); - - $theme_key = esc_html( $theme['Stylesheet'] ); + // preorder + $actions = array( + 'enable' => '', + 'disable' => '', + 'edit' => '' + ); - if ( empty( $theme['enabled'] ) ) - $actions['enable'] = '' . __('Enable') . ''; - else - $actions['disable'] = '' . __('Disable') . ''; - - if ( current_user_can('edit_themes') ) - $actions['edit'] = '' . __('Edit') . ''; + $theme_key = esc_html( $theme['Stylesheet'] ); - $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context ); - $actions = apply_filters( "theme_action_links_$theme_key", $actions, $theme_key, $theme, $context ); + if ( empty( $theme['enabled'] ) ) + $actions['enable'] = '' . __('Enable') . ''; + else + $actions['disable'] = '' . __('Disable') . ''; - $class = empty( $theme['enabled'] ) ? 'inactive' : 'active'; - $checkbox = ""; + if ( current_user_can('edit_themes') ) + $actions['edit'] = '' . __('Edit') . ''; - $description = '

' . $theme['Description'] . '

'; - $theme_name = $theme['Name']; + $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context ); + $actions = apply_filters( "theme_action_links_$theme_key", $actions, $theme_key, $theme, $context ); + $class = empty( $theme['enabled'] ) ? 'inactive' : 'active'; + $checkbox_id = md5($theme['Name']) . "_checkbox"; + $checkbox = ""; - $id = sanitize_title( $theme_name ); + $description = '

' . $theme['Description'] . '

'; + $theme_name = $theme['Name']; - echo " - - $checkbox - $theme_name - $description - - - - "; + $id = sanitize_title( $theme_name ); - echo $this->row_actions( $actions, true ); + echo ""; - echo " - "; - $theme_meta = array(); - if ( !empty( $theme['Version'] ) ) - $theme_meta[] = sprintf( __( 'Version %s' ), $theme['Version'] ); - if ( !empty( $theme['Author'] ) ) { - $author = $theme['Author']; - if ( !empty( $theme['Author URI'] ) ) - $author = '' . $theme['Author'] . ''; - $theme_meta[] = sprintf( __( 'By %s' ), $author ); + list( $columns, $hidden ) = $this->get_column_info(); + + foreach ( $columns as $column_name => $column_display_name ) { + $style = ''; + if ( in_array( $column_name, $hidden ) ) + $style = ' style="display:none;"'; + + switch ( $column_name ) { + case 'cb': + echo "$checkbox"; + break; + case 'name': + echo "$theme_name"; + echo $this->row_actions( $actions, true ); + echo ""; + break; + case 'description': + echo " +
$description
+
"; + + $theme_meta = array(); + if ( !empty( $theme['Version'] ) ) + $theme_meta[] = sprintf( __( 'Version %s' ), $theme['Version'] ); + if ( !empty( $theme['Author'] ) ) { + $author = $theme['Author']; + if ( !empty( $theme['Author URI'] ) ) + $author = '' . $theme['Author'] . ''; + $theme_meta[] = sprintf( __( 'By %s' ), $author ); + } + if ( !empty( $theme['Theme URI'] ) ) + $theme_meta[] = '' . __( 'Visit Theme Site' ) . ''; + + $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $theme_key, $theme, $status ); + echo implode( ' | ', $theme_meta ); + + echo "
"; + break; + break; + default: + echo ""; + do_action( 'manage_themes_custom_column', $column_name, $theme_key, $theme ); + echo ""; } - if ( !empty( $theme['Theme URI'] ) ) - $theme_meta[] = '' . __( 'Visit Theme Site' ) . ''; - - $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $theme_key, $theme, $status ); - echo implode( ' | ', $theme_meta ); - echo " - \n"; - - do_action( 'after_theme_row', $theme_key, $theme, $status ); - do_action( "after_theme_row_$theme_key", $theme_key, $theme, $status ); } + + echo ""; + + do_action( 'after_theme_row', $theme_key, $theme, $status ); + do_action( "after_theme_row_$theme_key", $theme_key, $theme, $status ); } } + ?>