-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
37 lines (32 loc) · 974 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Uninstall script for Blog Post Connector Plugin.
*
* This file is called when the plugin is uninstalled
*/
// Exit if accessed directly.
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
// Function to remove plugin-specific options from the options table.
function sm_remove_options() {
global $wpdb;
// Specify the options to be removed.
$options = [
'sm_post_connector_token',
'sm_post_connector_default_post_type',
'sm_post_connector_default_author',
'sm_post_connector_default_category',
'sm_post_connector_secret_key',
'sm_post_connector_logo',
'_transient_timeout_sm_post_connector_latest_release',
'_site_transient_update_plugins',
];
// Loop through each option and delete it.
foreach ($options as $option) {
// Use delete_option() for regular options
delete_option($option);
}
}
// Execute the removal functions.
sm_remove_options();