- <td>" . ( $broken_theme->get( 'Name' ) ? $broken_theme->get( 'Name' ) : $broken_theme->get_stylesheet() ) . "</td>
- <td>" . $broken_theme->errors()->get_error_message() . "</td>
- </tr>";
- }
-?>
+ <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
+ <td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
+ <?php
+ if ( $can_delete ) {
+ $stylesheet = $broken_theme->get_stylesheet();
+ $delete_url = add_query_arg( array(
+ 'action' => 'delete',
+ 'stylesheet' => urlencode( $stylesheet ),
+ ), admin_url( 'themes.php' ) );
+ $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
+ ?>
+ <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a></td>
+ <?php
+ }
+ ?>
+ </tr>
+ <?php endforeach; ?>