Restore to commit 74e578279624c6045ca440a3459ebfa1f8d54191
This commit is contained in:
31
chat/templates/Announcements/uninstall.php
Normal file
31
chat/templates/Announcements/uninstall.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Uninstall script for PC Announcements 274
|
||||
* This script runs when the plugin is uninstalled from WordPress
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Plugin options to delete
|
||||
$options_to_delete = array(
|
||||
'pc_announcements_274_version',
|
||||
'pc_announcements_274_db_version'
|
||||
);
|
||||
|
||||
// Delete options
|
||||
foreach ($options_to_delete as $option) {
|
||||
delete_option($option);
|
||||
}
|
||||
|
||||
// Delete database table
|
||||
global $wpdb;
|
||||
if (isset($wpdb)) {
|
||||
$table_name = $wpdb->prefix . 'pc_announcements_274';
|
||||
$wpdb->query("DROP TABLE IF EXISTS $table_name");
|
||||
}
|
||||
|
||||
// Clear any cached data
|
||||
wp_cache_flush();
|
||||
Reference in New Issue
Block a user