-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
43 lines (38 loc) · 1.09 KB
/
Copy pathuninstall.php
File metadata and controls
43 lines (38 loc) · 1.09 KB
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
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
$icxcnika_delayed_cleanup = static function (): void {
global $wpdb;
delete_option( 'icxcnika_delayed_settings' );
delete_option( 'icxcnika_delayed_seen' );
delete_option( 'icxcnika_delayed_registry_key' );
delete_transient( 'icxcnika_delayed_release' );
wp_clear_scheduled_hook( 'icxcnika_delayed_registry_ping' );
wp_clear_scheduled_hook( 'icxcnika_delayed_digest' );
$names = $wpdb->get_col(
$wpdb->prepare(
"SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE %s",
$wpdb->esc_like( '_transient_icxcnika_delayed_rel_' ) . '%'
)
);
foreach ( (array) $names as $name ) {
delete_transient( substr( (string) $name, strlen( '_transient_' ) ) );
}
};
if ( is_multisite() ) {
$icxcnika_delayed_sites = get_sites(
array(
'fields' => 'ids',
'number' => 0,
)
);
foreach ( $icxcnika_delayed_sites as $icxcnika_delayed_site_id ) {
switch_to_blog( (int) $icxcnika_delayed_site_id );
$icxcnika_delayed_cleanup();
restore_current_blog();
}
} else {
$icxcnika_delayed_cleanup();
}