$tableDesign) { if ($wpdb->get_var("show tables like '$tableName'") != $tableName) { $wpdb->query($tableDesign); } } // get the current database version $currentDbVersion = (int)get_option('alc_db_version'); // do we need to upgrade the database? if ($alc_db_version > $currentDbVersion) { // run through the upgrades version by version for ($version = $currentDbVersion ; $version <= $alc_db_version ; $version++) { // is this an array ? if (is_array($dbChanges[$version])) { // iterate through the changes for each version foreach ($dbChanges[$version] as $change) { if ($change) { $wpdb->query($change); } } } } // update the database version option update_option('alc_db_version', $alc_db_version); } add_option('alc_url_trigger', ALC_DEFAULTURLTRIGGER); } function alc_uninstall() { global $wpdb, $table_prefix; // remove db tables $wpdb->query("DROP table {$table_prefix}alc_link"); $wpdb->query("DROP table {$table_prefix}alc_address"); $wpdb->query("DROP table {$table_prefix}alc_redirectlog"); // remove options delete_option('alc_url_trigger'); delete_option('alc_db_version'); } ?>