-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathuninstall.php
More file actions
34 lines (28 loc) · 973 Bytes
/
uninstall.php
File metadata and controls
34 lines (28 loc) · 973 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
27
28
29
30
31
32
33
34
<?php
/**
* Colorlib Login Customizer Uninstall
*
* This file runs when the plugin is uninstalled (deleted).
* This will not run when the plugin is deactivated.
* Cleans up all plugin data from the database.
*
* @package Colorlib_Login_Customizer
*/
declare( strict_types=1 );
// If plugin is not being uninstalled, exit (do nothing).
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// Delete main plugin options.
delete_option( 'clc-options' );
delete_option( 'colorlib-login-customizer_version' );
// Delete review notice options and transients.
delete_option( 'colorlib-login-customizer_review_notice' );
delete_transient( 'colorlib-login-customizer_review_notice' );
// Clean up any user meta for dismissed notices.
$users = get_users( array( 'fields' => 'ID' ) );
foreach ( $users as $user_id ) {
delete_user_meta( $user_id, 'colorlib-login-customizer_dismiss_notice' );
}
// Clear object cache.
wp_cache_flush();