-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.php
22 lines (20 loc) · 855 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
<?php
// If this file is called directly, abort.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
die;
}
// Delete plugin options
delete_option( 'bluesky_settings' ); // Main plugin options
delete_option( 'bluesky_settings_secret' ); // API secret or key, if applicable
delete_option( 'bluesky_settings__activation_date' ); // The activation date of the plugin (from v1.3.0)
// Fetch all options
$options = wp_load_alloptions();
// Delete all transients related to the plugin
// Loop through options to find and delete relevant transients
foreach ( $options as $option_name => $option_value ) {
if ( strpos( $option_name, '_transient_bluesky_cache_' ) === 0 ) {
// Strip '_transient_' to get the actual transient key
$transient_key = str_replace( '_transient_', '', $option_name );
delete_transient( $transient_key );
}
}