-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.php
19 lines (16 loc) · 832 Bytes
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/*
Always check for the constant WP_UNINSTALL_PLUGIN in uninstall.php before doing anything. This protects against direct access.
The constant will be defined by WordPress during the uninstall.php invocation.
The constant is NOT defined when uninstall is performed by `register_uninstall_hook`.
Reference: https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/#method-2-uninstall-php
*/
defined( 'WP_UNINSTALL_PLUGIN' ) || exit( 1 );
// $option_name = 'your_plugin_option';
// delete_option( $option_name );
//// Use `delete_site_option` in Multisite. Note: In Multisite, looping through all blogs to delete options can be very resource intensive.
// delete_site_option( $option_name );
// global $wpdb;
// $wpdb->query(
// "DROP TABLE IF EXISTS {$wpdb->prefix}yourtable" // drop a custom db table
// );