22 lines
564 B
PHP
22 lines
564 B
PHP
<?php
|
|
// File: uninstall.php
|
|
// If uninstall not called from WordPress, exit
|
|
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
|
exit;
|
|
}
|
|
|
|
// Check if we should delete data on uninstall
|
|
$delete_data = get_option('pc_hfap_delete_data_on_uninstall', false);
|
|
|
|
if ($delete_data) {
|
|
global $wpdb;
|
|
|
|
// Delete the snippets table
|
|
$table_name = $wpdb->prefix . 'pc_hfap_snippets';
|
|
$wpdb->query("DROP TABLE IF EXISTS $table_name");
|
|
|
|
// Delete all plugin options
|
|
delete_option('pc_hfap_delete_data_on_uninstall');
|
|
delete_option('pc_hfap_version');
|
|
}
|