-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuninstall.php
More file actions
26 lines (22 loc) · 598 Bytes
/
Copy pathuninstall.php
File metadata and controls
26 lines (22 loc) · 598 Bytes
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
<?php
/**
* Uninstall handler: removes plugin transients and options.
*
* @package Online_Active_Users
*/
// If uninstall is not called from WordPress, exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit();
}
// Delete plugin transient.
delete_transient( 'users_status' );
// Delete all custom transients.
$wpoau_stored_keys = get_option( 'wpoau_transient_keys', array() );
if ( ! empty( $wpoau_stored_keys ) ) {
foreach ( $wpoau_stored_keys as $wpoau_key ) {
delete_transient( $wpoau_key );
}
delete_option( 'wpoau_transient_keys' );
}
// Optional: Clear cache.
wp_cache_flush();