Changeset 21010 for trunk/wp-admin/includes/theme.php
- Timestamp:
- 06/06/2012 08:34:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/theme.php
r20752 r21010 12 12 * @since 2.8.0 13 13 * 14 * @param string $ template Template directoryof the theme to delete14 * @param string $stylesheet Stylesheet of the theme to delete 15 15 * @param string $redirect Redirect to page when complete. 16 16 * @return mixed 17 17 */ 18 function delete_theme($ template, $redirect = '') {18 function delete_theme($stylesheet, $redirect = '') { 19 19 global $wp_filesystem; 20 20 21 if ( empty($ template) )21 if ( empty($stylesheet) ) 22 22 return false; 23 23 24 24 ob_start(); 25 25 if ( empty( $redirect ) ) 26 $redirect = wp_nonce_url('themes.php?action=delete& template=' . $template, 'delete-theme_' . $template);26 $redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . $stylesheet, 'delete-theme_' . $stylesheet); 27 27 if ( false === ($credentials = request_filesystem_credentials($redirect)) ) { 28 28 $data = ob_get_contents(); … … 62 62 63 63 $themes_dir = trailingslashit( $themes_dir ); 64 $theme_dir = trailingslashit($themes_dir . $ template);64 $theme_dir = trailingslashit($themes_dir . $stylesheet); 65 65 $deleted = $wp_filesystem->delete($theme_dir, true); 66 66 67 67 if ( ! $deleted ) 68 return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s.'), $ template) );68 return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s.'), $stylesheet) ); 69 69 70 70 // Force refresh of theme update information
Note: See TracChangeset
for help on using the changeset viewer.