| 1 |
<?php |
| 2 |
|
| 3 |
//if uninstall not called from WordPress exit |
| 4 |
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 5 |
exit(); |
| 6 |
} |
| 7 |
|
| 8 |
// Delete options |
| 9 |
if (defined('STAGS_OPTIONS_NAME')) { |
| 10 |
delete_option( STAGS_OPTIONS_NAME ); // Options plugin |
| 11 |
delete_option( STAGS_OPTIONS_NAME . '-version' ); // Version ST |
| 12 |
|
| 13 |
delete_option( STAGS_OPTIONS_NAME_AUTO ); // Options auto tags |
| 14 |
} |
| 15 |
delete_option( 'tmp_auto_tags_st' ); // Autotags Temp |
| 16 |
|
| 17 |
delete_option( 'stp_options' ); // Old options from Simple Tagging ! |
| 18 |
delete_option( 'widget_stags_cloud' ); // Widget |
| 19 |
|
| 20 |
// remove permissions from role |
| 21 |
if ( function_exists( 'get_role' ) ) { |
| 22 |
$role = get_role( 'administrator' ); |
| 23 |
if ( $role != null ) { |
| 24 |
$role->remove_cap( 'simple_tags' ); |
| 25 |
$role->remove_cap( 'admin_simple_tags' ); |
| 26 |
} |
| 27 |
|
| 28 |
$role = get_role( 'editor' ); |
| 29 |
if ( $role != null ) { |
| 30 |
$role->remove_cap( 'simple_tags' ); |
| 31 |
$role->remove_cap( 'admin_simple_tags' ); |
| 32 |
} |
| 33 |
|
| 34 |
// Clean var |
| 35 |
unset( $role ); |
| 36 |
} |