- $main_theme = get_current_theme();
- $files_to_delete = $theme_info = array();
- foreach ( $themes as $key => $theme ) {
- $data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' );
- if ( $data['Name'] == $main_theme ) {
- unset( $themes[$key] );
- } else {
- $files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
- $theme_info[ $theme ] = $data;
- }
- }