insert-headers-and-footers
Last commit date
admin
3 years ago
build
3 years ago
includes
3 years ago
languages
3 years ago
ihaf.php
3 years ago
readme.txt
3 years ago
uninstall.php
3 years ago
uninstall.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Uninstall WPCode. |
| 4 | * |
| 5 | * Remove: |
| 6 | * - custom capabilities. |
| 7 | * |
| 8 | * @package WPCode |
| 9 | */ |
| 10 | |
| 11 | // Exit if accessed directly. |
| 12 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | // If the function already exists we shouldn't run the uninstall as another version of the plugin is active. |
| 17 | if ( function_exists( 'WPCode' ) ) { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | require_once 'ihaf.php'; |
| 22 | |
| 23 | if ( class_exists( 'WPCode_Capabilities' ) ) { |
| 24 | // Remove custom capabilities on uninstall. |
| 25 | WPCode_Capabilities::uninstall(); |
| 26 | } |
| 27 | |
| 28 | if ( class_exists( 'WPCode_Notifications' ) ) { |
| 29 | WPCode_Notifications::delete_notifications_data(); |
| 30 | } |
| 31 | |
| 32 | if ( function_exists( 'wp_unschedule_hook' ) ) { |
| 33 | wp_unschedule_hook( 'wpcode_usage_tracking_cron' ); |
| 34 | } |
| 35 | |
| 36 | delete_option( 'wpcode_send_usage_last_run' ); |
| 37 | delete_option( 'wpcode_usage_tracking_config' ); |
| 38 |