-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
26 lines (21 loc) · 742 Bytes
/
Copy pathuninstall.php
File metadata and controls
26 lines (21 loc) · 742 Bytes
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
<?php
/**
* Optional uninstall cleanup for Navigation Studio.
*
* @package NavigationStudio
*/
defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
if ( ! get_option( 'navstudio_delete_data_on_uninstall', false ) ) {
return;
}
global $wpdb;
$tables = array( 'navstudio_drafts', 'navstudio_revisions', 'navstudio_templates' );
foreach ( $tables as $suffix ) {
$table = $wpdb->prefix . $suffix;
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Trusted prefix and constant allowlist.
$wpdb->query( "DROP TABLE IF EXISTS `$table`" );
}
delete_option( 'navstudio_schema_version' );
delete_option( 'navstudio_settings' );
delete_option( 'navstudio_delete_data_on_uninstall' );
delete_site_option( 'navstudio_schema_version' );