-
Notifications
You must be signed in to change notification settings - Fork 8
/
uninstall.php
39 lines (29 loc) · 1.06 KB
/
uninstall.php
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
31
32
33
34
35
36
37
38
39
<?php
defined( 'WP_UNINSTALL_PLUGIN' ) or die();
/**
* NOTE: There doesn't seem to be a sane way of accessing the FontsamplerPlugin
* or related classes; table names and option names are magical ;(
*/
global $wpdb;
$sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'fontsampler_sets_x_fonts';
$wpdb->query( $sql );
$sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'fontsampler_fonts';
$wpdb->query( $sql );
$sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'fontsampler_sets';
$wpdb->query( $sql );
$sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'fontsampler_settings';
$wpdb->query( $sql );
// finally, remove fontsampler settings from wp_options
if ( get_option( 'fontsampler_db_version' ) ) {
delete_option( 'fontsampler_db_version' );
}
if ( get_option( 'fontsampler_hide_legacy_formats' ) ) {
delete_option( 'fontsampler_hide_legacy_formats' );
}
if ( get_option( 'fontsampler_last_changelog' ) ) {
delete_option( 'fontsampler_last_changelog' );
}
if ( get_option( 'fontsampler_proxy_urls' ) ) {
delete_option( 'fontsampler_proxy_urls' );
}
flush_rewrite_rules();