From: Steve Sutton Date: Thu, 15 Sep 2016 17:41:53 +0000 (-0400) Subject: Update deactive part for removing cron schedules X-Git-Tag: v1.4.0^2~29 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5019f733674156084cdf59364fe3e80564a89e24;p=WP-Plugins%2Fglm-member-db-events.git Update deactive part for removing cron schedules Need to do the wpdb way of getting the feed_import list instead of using the data abstract way. Data abstract way is not available when the main member db plugin is deactivated and will cause an error when trying to run. --- diff --git a/deactivate.php b/deactivate.php index 74ef441..ebb97e3 100644 --- a/deactivate.php +++ b/deactivate.php @@ -30,7 +30,6 @@ if (!defined('ABSPATH')) { die("Please do not call this code directly!"); } -require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataFeedImport.php'; /* * This class performs all necessary additional work when this * plugin is deactivated. @@ -76,11 +75,14 @@ class glmMembersEventsPluginDeactivate { // clear the cron schedule for this plugin wp_clear_scheduled_hook( GLM_MEMBERS_EVENTS_PLUGIN_CRON_EVENT ); - $importFeeds = new GlmDataFeedImport( $this->wpdb, $this->config ); - $import_feeds = $importFeeds->getList(); + $import_feeds = $this->wpdb->get_results( + "SELECT id + FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "feed_import", + ARRAY_A + ); if ( $import_feeds ) { - foreach ( $import_feeds as $key => &$feed ) { - // check the next run time + foreach ( $import_feeds as $key => $feed ) { + // clear the scheduled hook for this feed_import id wp_clear_scheduled_hook( GLM_MEMBERS_EVENTS_PLUGIN_CRON_EVENT, array( (int)$feed['id'] ) ); } }