forked from TaxoPress/TaxoPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
34 lines (27 loc) · 876 Bytes
/
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
<?php
//if uninstall not called from WordPress exit
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit();
}
// Delete options
delete_option( STAGS_OPTIONS_NAME ); // Options plugin
delete_option( STAGS_OPTIONS_NAME . '-version' ); // Version ST
delete_option( STAGS_OPTIONS_NAME_AUTO ); // Options auto tags
delete_option( 'tmp_auto_tags_st' ); // Autotags Temp
delete_option( 'stp_options' ); // Old options from Simple Tagging !
delete_option( 'widget_stags_cloud' ); // Widget
// remove permissions from role
if ( function_exists( 'get_role' ) ) {
$role = get_role( 'administrator' );
if ( $role != null ) {
$role->remove_cap( 'simple_tags' );
$role->remove_cap( 'admin_simple_tags' );
}
$role = get_role( 'editor' );
if ( $role != null ) {
$role->remove_cap( 'simple_tags' );
$role->remove_cap( 'admin_simple_tags' );
}
// Clean var
unset( $role );
}