Ticket #16401: 16401.diff
File 16401.diff, 1.1 KB (added by , 3 years ago) |
---|
-
src/wp-admin/includes/theme.php
72 72 return new WP_Error( 'fs_no_themes_dir', __( 'Unable to locate WordPress theme directory.' ) ); 73 73 } 74 74 75 /** 76 * Fires immediately before a theme deletion attempt. 77 * 78 * @since 5.8 79 * 80 * @param string $stylesheet Stylesheet of the theme to delete. 81 */ 82 do_action( 'delete_theme', $stylesheet ); 83 75 84 $themes_dir = trailingslashit( $themes_dir ); 76 85 $theme_dir = trailingslashit( $themes_dir . $stylesheet ); 77 86 $deleted = $wp_filesystem->delete( $theme_dir, true ); 78 87 88 /** 89 * Fires immediately after a theme deletion attempt. 90 * 91 * @since 5.8 92 * 93 * @param string $stylesheet Stylesheet of the theme to delete. 94 * @param bool $deleted Whether the theme deletion was successful. 95 */ 96 do_action( 'deleted_theme', $stylesheet, $deleted ); 97 79 98 if ( ! $deleted ) { 80 99 return new WP_Error( 81 100 'could_not_remove_theme',