wpdb = $wpdb; $this->options = $settings->get_settings(); $this->cacheDir = OMGF_FONTS_DIR; $this->remove_db_entries(); $this->delete_files(); $this->delete_dir(); } /** * Remove all settings stored in the wp_options table. */ private function remove_db_entries() { foreach ($this->options as $key => $option) { delete_option($option); } } /** * Delete all files stored in the cache directory. * * @return array */ private function delete_files() { return array_map('unlink', glob($this->cacheDir . '/*.*')); } /** * Delete the cache directory. * * @return bool */ private function delete_dir() { return rmdir($this->cacheDir); } }