forked from amdrew/post-promoter-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
32 lines (28 loc) · 891 Bytes
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Runs whenever the 'uninstall' link is clicked in the Plugins List
*
* Removes our settings if the option to 'delete on uninstall is set'
*/
$options = get_option( 'ppp_options' );
if ( isset( $options['delete_on_uninstall'] ) ) {
require_once 'includes/cron-functions.php';
$crons = ppp_get_shceduled_crons();
foreach( $crons as $cron ) {
$ppp_data = $cron['ppp_share_post_event'];
$array_keys = array_keys( $ppp_data );
$hash_key = $array_keys[0];
$event_info = $ppp_data[$hash_key];
ppp_remove_scheduled_shares( $event_info['args'][0] );
}
delete_option( 'ppp_options' );
delete_option( '_ppp_license_key' );
delete_option( 'ppp_social_settings' );
delete_option( 'ppp_share_settings' );
delete_option( '_ppp_license_key_status' );
delete_transient( 'ppp_social_tokens' );
}