Changeset 29856 for trunk/src/wp-admin/includes/theme.php
- Timestamp:
- 10/08/2014 07:04:05 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r29479 r29856 56 56 return new WP_Error('fs_error', __('Filesystem error.'), $wp_filesystem->errors); 57 57 58 // Get the base plugin folder58 // Get the base plugin folder. 59 59 $themes_dir = $wp_filesystem->wp_themes_dir(); 60 if ( empty($themes_dir) ) 61 return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress theme directory.')); 60 if ( empty( $themes_dir ) ) { 61 return new WP_Error( 'fs_no_themes_dir', __( 'Unable to locate WordPress theme directory.' ) ); 62 } 62 63 63 64 $themes_dir = trailingslashit( $themes_dir ); 64 $theme_dir = trailingslashit($themes_dir . $stylesheet); 65 $deleted = $wp_filesystem->delete($theme_dir, true); 66 67 if ( ! $deleted ) 68 return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s.'), $stylesheet) ); 69 70 // Force refresh of theme update information 71 delete_site_transient('update_themes'); 65 $theme_dir = trailingslashit( $themes_dir . $stylesheet ); 66 $deleted = $wp_filesystem->delete( $theme_dir, true ); 67 68 if ( ! $deleted ) { 69 return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) ); 70 } 71 72 $translations_dir = $wp_filesystem->wp_lang_dir(); 73 $translations_dir = trailingslashit( $translations_dir ); 74 75 $theme_translations = wp_get_installed_translations( 'themes' ); 76 77 // Remove language files, silently. 78 if ( ! empty( $theme_translations[ $stylesheet ] ) ) { 79 $translations = $theme_translations[ $stylesheet ]; 80 81 foreach ( $translations as $translation => $data ) { 82 $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.po' ); 83 $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.mo' ); 84 } 85 } 86 87 // Force refresh of theme update information. 88 delete_site_transient( 'update_themes' ); 72 89 73 90 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)