+
+ 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 install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
+ <?php
+ }
+ }