Files
wp-plugin-swiss-football-ma…/uninstall.php
T

29 lines
828 B
PHP

<?php
// If uninstall not called from WordPress, exit
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
// Remove plugin options
delete_option('swi_foot_api_base_url');
delete_option('swi_foot_api_username');
delete_option('swi_foot_api_password');
delete_option('swi_foot_verein_id');
delete_option('swi_foot_season_id');
delete_option('swi_foot_match_cache_duration');
// Remove transients and cached match data
delete_transient('swi_foot_access_token');
delete_transient('swi_foot_teams');
$keys = get_transient('swi_foot_match_keys');
if (is_array($keys)) {
foreach ($keys as $mid) {
delete_transient('swi_foot_match_' . $mid);
}
}
delete_transient('swi_foot_match_keys');
delete_transient('swi_foot_commons_ids');
// Remove permanently saved finished matches
delete_option('swi_foot_finished_matches');