Ticket #14955: 14955.1.diff
File 14955.1.diff, 1.2 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/theme.php
55 55 if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) 56 56 return new WP_Error('fs_error', __('Filesystem error.'), $wp_filesystem->errors); 57 57 58 //Get the base pluginfolder58 //Get the base theme folder 59 59 $themes_dir = $wp_filesystem->wp_themes_dir(); 60 60 if ( empty($themes_dir) ) 61 61 return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress theme directory.')); 62 62 63 63 $themes_dir = trailingslashit( $themes_dir ); 64 $theme_dir = trailingslashit($themes_dir . $stylesheet); 65 $deleted = $wp_filesystem->delete($theme_dir, true); 64 $theme_dir = trailingslashit( $themes_dir . $stylesheet ); 65 66 if ( file_exists( $theme_dir . '/uninstall.php' ) ) { 67 define( 'WP_UNINSTALL_THEME', true ); 68 include( $theme_dir . '/uninstall.php' ); 69 } 70 do_action( 'uninstall_theme', $theme_dir ); 71 72 $deleted = $wp_filesystem->delete( $theme_dir, true ); 66 73 67 74 if ( ! $deleted ) 68 75 return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s.'), $stylesheet) );