mirror of
https://github.com/WenPai-org/wptag.git
synced 2025-08-03 12:23:41 +08:00
Introduce the main admin controllers, AJAX handlers, UI partials, and core classes for the WPTag plugin. This includes admin interface components, dashboard, settings, snippet management, asset files, and localization support. These files establish the foundation for managing code snippets, templates, and plugin settings within the WordPress admin.
41 lines
724 B
PHP
41 lines
724 B
PHP
<?php
|
|
|
|
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
|
exit;
|
|
}
|
|
|
|
$settings = get_option('wptag_settings', []);
|
|
|
|
if (empty($settings['cleanup_on_uninstall'])) {
|
|
return;
|
|
}
|
|
|
|
global $wpdb;
|
|
|
|
$tables = [
|
|
$wpdb->prefix . 'wptag_snippets',
|
|
$wpdb->prefix . 'wptag_templates',
|
|
$wpdb->prefix . 'wptag_logs'
|
|
];
|
|
|
|
foreach ($tables as $table) {
|
|
$wpdb->query("DROP TABLE IF EXISTS {$table}");
|
|
}
|
|
|
|
$options = [
|
|
'wptag_db_version',
|
|
'wptag_settings',
|
|
'wptag_activated',
|
|
'wptag_cache_cleared'
|
|
];
|
|
|
|
foreach ($options as $option) {
|
|
delete_option($option);
|
|
}
|
|
|
|
delete_transient('wptag_admin_notice');
|
|
|
|
wp_clear_scheduled_hook('wptag_cleanup_logs');
|
|
wp_clear_scheduled_hook('wptag_cache_cleanup');
|
|
|
|
wp_cache_flush();
|