/** * Installs the database tables and content gateway pages * * @author Jonathan Davis * @since 1.1 * * @return void **/ public function install() { global $wpdb, $wp_rewrite, $wp_version, $table_prefix; if (!file_exists(SHOPP_DBSCHEMA)) { $this->error('nodbschema-install'); } // Remove any old product post types and taxonomies to prevent duplication of irrelevant data sDB::query("DELETE FROM {$wpdb->posts} WHERE post_type='" . ShoppProduct::$posttype . "'"); sDB::query("DELETE FROM {$wpdb->term_taxonomy} WHERE taxonomy='" . ProductCategory::$taxon . "' OR taxonomy='" . ProductTag::$taxon . "'"); // Install tables ob_start(); include SHOPP_DBSCHEMA; $schema = ob_get_clean(); sDB::loaddata($schema); unset($schema); }