custom-twitter-feeds
Last commit date
css
9 years ago
fonts
9 years ago
img
9 years ago
inc
9 years ago
js
9 years ago
views
9 years ago
README.txt
9 years ago
custom-twitter-feed.php
9 years ago
uninstall.php
9 years ago
uninstall.php
49 lines
| 1 | <?php |
| 2 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 3 | exit(); |
| 4 | } |
| 5 | |
| 6 | //If the user is preserving the settings then don't delete them |
| 7 | $options = get_option( 'ctf_configure' ); |
| 8 | $ctf_preserve_settings = $options[ 'preserve_settings' ]; |
| 9 | |
| 10 | // allow the user to preserve their settings in case they are upgrading |
| 11 | if ( ! $ctf_preserve_settings ) { |
| 12 | // clean up options from the database |
| 13 | delete_option( 'ctf_configure' ); |
| 14 | delete_option( 'ctf_customize' ); |
| 15 | delete_option( 'ctf_style' ); |
| 16 | delete_option( 'ctf_options' ); |
| 17 | delete_option( 'ctf_version' ); |
| 18 | delete_option( 'ctf_rating_notice' ); |
| 19 | delete_transient( 'custom_twitter_feeds_rating_notice_waiting' ); |
| 20 | |
| 21 | // delete tweet cache in transients |
| 22 | global $wpdb; |
| 23 | $table_name = $wpdb->prefix . "options"; |
| 24 | $wpdb->query( " |
| 25 | DELETE |
| 26 | FROM $table_name |
| 27 | WHERE `option_name` LIKE ('%\_transient\_ctf\_%') |
| 28 | " ); |
| 29 | $wpdb->query( " |
| 30 | DELETE |
| 31 | FROM $table_name |
| 32 | WHERE `option_name` LIKE ('%\_transient\_timeout\_ctf\_%') |
| 33 | " ); |
| 34 | |
| 35 | //Delete all persistent caches (start with ctf_!) |
| 36 | global $wpdb; |
| 37 | $table_name = $wpdb->prefix . "options"; |
| 38 | $result = $wpdb->query(" |
| 39 | DELETE |
| 40 | FROM $table_name |
| 41 | WHERE `option_name` LIKE ('%ctf\_\!%') |
| 42 | "); |
| 43 | delete_option( 'ctf_cache_list' ); |
| 44 | |
| 45 | // remove any scheduled cron jobs |
| 46 | wp_clear_scheduled_hook( 'ctf_cron_job' ); |
| 47 | } |
| 48 | |
| 49 |