| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fired when the plugin is uninstalled. |
| 5 |
* |
| 6 |
* When populating this file, consider the following flow |
| 7 |
* of control: |
| 8 |
* |
| 9 |
* - This method should be static |
| 10 |
* - Check if the $_REQUEST content actually is the plugin name |
| 11 |
* - Run an admin referrer check to make sure it goes through authentication |
| 12 |
* - Verify the output of $_GET makes sense |
| 13 |
* - Repeat with other user roles. Best directly by using the links/query string parameters. |
| 14 |
* - Repeat things for multisite. Once for a single site in the network, once sitewide. |
| 15 |
* |
| 16 |
* This file may be updated more in future version of the Boilerplate; however, this is the |
| 17 |
* general skeleton and outline for how the file should work. |
| 18 |
* |
| 19 |
* For more information, see the following discussion: |
| 20 |
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913 |
| 21 |
* |
| 22 |
* @link http://nabillemsieh.com |
| 23 |
* @since 1.0.0 |
| 24 |
* |
| 25 |
* @package Hurrytimer |
| 26 |
*/ |
| 27 |
|
| 28 |
// If uninstall not called from WordPress, then exit. |
| 29 |
if ( ! defined('WP_UNINSTALL_PLUGIN')) { |
| 30 |
exit; |
| 31 |
} |
| 32 |
|
| 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']); |
| 37 |
|
| 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'); |
| 46 |
|