-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
21 lines (16 loc) · 909 Bytes
/
Copy pathuninstall.php
File metadata and controls
21 lines (16 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// if uninstall not called from WordPress exit
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
exit();
// NOTE: This should correspond to the pointer_name in the main plugin file
$pointerName = strtolower( 'GambitCachePlugin' );
// Deletes the dismissed admin pointer for this plugin
$dismissedAdminPointers = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers' );
$dismissedAdminPointers = preg_replace( '/' . $pointerName . '(,)?)/', NULL, $dismissedAdminPointers['0'] );
$dismissedAdminPointers = preg_replace( '/(,)$/', NULL, $dismissedAdminPointers );
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissedAdminPointers );
// Delete all transients
global $wpdb;
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_%' AND option_name LIKE '%cmbntr%'" );
delete_option( 'gambit_cache_found_js' );
delete_option( 'gambit_cache_found_css' );