| @@ -25,25 +25,21 @@ | ||
| 25 | 25 | * @package Hurrytimer |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | // If uninstall not called from WordPress, then exit. |
| 29 | -if (!defined('WP_UNINSTALL_PLUGIN')) { | |
| 29 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) { | |
| 30 | 30 | exit; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | -global $wpdb; | |
| 33 | +// global $wpdb; | |
| 34 | +// $table = $wpdb->prefix . 'hurrytimer_evergreen'; | |
| 35 | +// $wpdb->query("DROP TABLE IF EXISTS $table"); | |
| 36 | +// $campaigns = get_posts(['post_type' => 'hurrytimer_countdown']); | |
| 34 | 37 | |
| 35 | -// Drop table from the database. | |
| 36 | -$table = $wpdb->prefix . 'hurrytimer_evergreen'; | |
| 37 | -$wpdb->query("DROP TABLE IF EXISTS $table"); | |
| 38 | - | |
| 39 | -// Delete countdowns. | |
| 40 | -$result = get_posts(['post_type' => 'hurrytimer_countdown']); | |
| 41 | -foreach ($result as $item) { | |
| 42 | - wp_delete_post($item->ID, true); | |
| 43 | -} | |
| 44 | -// Delete options. | |
| 45 | -delete_option('hurrytimer_version'); | |
| 46 | -delete_site_option('hurrytimer_version'); | |
| 47 | - | |
| 48 | -// Cancel schedules. | |
| 49 | -wp_clear_scheduled_hook('hurrytimer_evergreen_daily_cleanup'); | |
| 38 | +// foreach ($campaigns as $campaign) { | |
| 39 | +// wp_delete_post($campaign->ID, true); | |
| 40 | +// } | |
| 41 | +// delete_option('hurrytimer_version'); | |
| 42 | +// delete_option('hurrytimer_db_version'); | |
| 43 | +// delete_site_option('hurrytimer_version'); | |
| 44 | +// delete_site_option('hurrytimer_db_version'); | |
| 45 | +// wp_clear_scheduled_hook('hurrytimer_evergreen_daily_cleanup'); | |