From: Steve Sutton Date: Sat, 17 Mar 2018 18:55:08 +0000 (-0400) Subject: Update for getting settings X-Git-Tag: v1.0.0^2~125 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=39f1151bcc7bd38dc128915204da9d8131f72650;p=WP-Plugins%2Fglm-member-db-billing.git Update for getting settings make sure the db version is set before getting any setting or management --- diff --git a/index.php b/index.php index 14ac901..932b64b 100644 --- a/index.php +++ b/index.php @@ -145,11 +145,13 @@ if (is_file(GLM_MEMBERS_BILLING_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { // Load Add-On Management Settings data /* None - Need to figure out a smooth way to do this. */ -$glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A ); -unset($glmMembersBillingSettings['id']); +if ( $glmMembersDatabasePluginVersion ) { + $glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A ); + unset($glmMembersBillingSettings['id']); -$glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); -unset($glmMembersBillingManagement['id']); + $glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); + unset($glmMembersBillingManagement['id']); +} function glmMembersBillingRegisterAddOn($addOns) {