-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
30 lines (26 loc) · 1.01 KB
/
uninstall.php
File metadata and controls
30 lines (26 loc) · 1.01 KB
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
<?php
/**
* Uninstall LightSpeed Site Plugin.
*
* This file runs when the plugin is deleted from the WordPress admin.
* Add any cleanup logic here — for example, removing options or custom tables.
*
* By default this plugin does NOT delete any data on uninstall.
* Uncomment and extend the sections below only when the plugin stores data
* and removal is the correct behaviour.
*
* @package LS_PLUGIN
*/
// Only run during a real uninstall triggered by WordPress.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// Example: Remove a plugin option.
// delete_option( 'ls_plugin_settings' );
// Example: Remove all plugin options by prefix.
// global $wpdb;
// $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'ls_plugin_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
// Example: Remove a custom database table.
// global $wpdb;
// $table_name = $wpdb->prefix . 'ls_plugin_data';
// $wpdb->query( "DROP TABLE IF EXISTS {$table_name}" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery