/** * Remove the files */ private function clean_up() { if (file_exists($this->filename) && is_writable($this->filename)) { unlink($this->filename); } if (!empty($this->file['file']) && file_exists($this->file['file']) && is_writable($this->file['file'])) { unlink($this->file['file']); } if (file_exists($this->path) && is_writable($this->path)) { $wp_file = new WP_Filesystem_Direct($this->path); $wp_file->rmdir($this->path, true); } }
/** * @access public * * @param string $path * @param bool $recursive * @return bool */ public function rmdir($path, $recursive = false) { if ($this->authorized()) { return parent::rmdir($path, $recursive); } else { return false; } }