+ <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
+ }
+
+ if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {
+ $parent_theme_name = $broken_theme->get( 'Template' );
+ $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );
+
+ if ( ! is_wp_error( $parent_theme ) ) {
+ $install_url = add_query_arg( array(
+ 'action' => 'install-theme',
+ 'theme' => urlencode( $parent_theme_name ),
+ ), admin_url( 'update.php' ) );
+ $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
+ ?>
+ <td><a href="<?php echo esc_url( $install_url ); ?>" class="button button-secondary install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
+ <?php
+ }
+ }
+ ?>
+ </tr>
+ <?php endforeach; ?>