| @@ -36,9 +36,33 @@ | ||
| 36 | 36 | */ |
| 37 | 37 | public function expressUninstall() { |
| 38 | 38 | // Clean up database |
| 39 | 39 | $this->database(); |
| 40 | + // Clean up file system! | |
| 41 | + $this->fileSystem(); | |
| 42 | + // Chaining! | |
| 43 | + return $this; | |
| 44 | + } | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * put your comment there... | |
| 48 | + * | |
| 49 | + */ | |
| 50 | + public function fileSystem() { | |
| 51 | + global $wp_filesystem; | |
| 52 | + // Getting directory list! | |
| 53 | + $wpContentDir = 'wp-content'; | |
| 54 | + $fSConfig = cssJSToolbox::$config->fileSystem; | |
| 55 | + // Directories to create! | |
| 56 | + $directories = array( | |
| 57 | + "{$wpContentDir}/{$fSConfig->contentDir}", | |
| 58 | + "{$wpContentDir}/{$fSConfig->contentDir}/{$fSConfig->templatesDir}", | |
| 59 | + ); | |
| 60 | + // Delete all directories! | |
| 61 | + foreach ($directories as $dir) { | |
| 62 | + $wp_filesystem->delete(ABSPATH . "/{$dir}", true); | |
| 63 | + } | |
| 40 | 64 | // Chaining! |
| 41 | 65 | return $this; |
| 42 | 66 | } |
| 43 | 67 | |
| 44 | 68 | } // End class. |