Function Reference: geodir_payment_uninstall

Summary

This function has not been documented yet.

Source Code

function geodir_payment_uninstall() {
	if (!isset($_REQUEST['verify-delete-adon'])) {
		$plugins = isset($_REQUEST['checked']) ? (array)$_REQUEST['checked'] : array();
		//$_POST = from the plugin form; $_GET = from the FTP details screen.
		
		wp_enqueue_script('jquery');
		
		require_once(ABSPATH . 'wp-admin/admin-header.php');
		printf( '

%s

' ,__( 'Warning!!' , 'geodir_payments') ); printf( '%s
%s

%s %s.' , __('You are about to delete a Geodirectory Adon which has important option and custom data associated to it.' ,'geodir_payments') ,__('Deleting this and activating another version, will be treated as a new installation of plugin, so all the data will be lost.', 'geodir_payments'), __('If you have any problem in upgrading the plugin please contact Geodirectory', 'geodir_payments') , __('support' ,'geodir_payments') ) ; ?>

'; } wp_nonce_field('bulk-plugins'); submit_button( __('Delete plugin files only', 'geodir_payments'), 'button', 'submit', false); ?>
'; } wp_nonce_field('bulk-plugins'); submit_button( __('Delete both plugin files and data', 'geodir_payments'), 'button', 'submit', false); ?>
query("UPDATE " . $table . " SET package_id='0', alive_days='0', paymentmethod='0', expire_date='Never', is_featured='0', paid_amount='0'"); if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = 'expire_notification'")) $wpdb->query("ALTER TABLE " . $table . " DROP expire_notification"); } } $wpdb->query("UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET packages='0'"); $wpdb->query("DROP TABLE " . $plugin_prefix . 'price'); $wpdb->query("DROP TABLE " . $plugin_prefix . 'coupons'); $wpdb->query("DROP TABLE " . $plugin_prefix . 'invoice'); $paymentinfo = $wpdb->get_results($wpdb->prepare("select option_id from " . $wpdb->prefix . "options where option_name like %s", array('payment_method_%'))); if (!empty($paymentinfo)) { foreach ($paymentinfo as $payment) { $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->prefix . "options WHERE option_id=%d ", array($payment->option_id))); } } /* --- delete coupon options --- */ delete_option('geodir_allow_coupon_code'); /* --- delete notification options --- */ $notifications = geodir_payment_notifications(); if (!empty($notifications)) { foreach ($notifications as $value) { if (isset($value['id']) && $value['id'] != '') delete_option($value['id']); } } /* --- delete default options --- */ $default_options = geodir_payment_general_options(); if (!empty($default_options)) { foreach ($default_options as $value) { if (isset($value['id']) && $value['id'] != '') delete_option($value['id']); } } /* --- delete custom sort options --- */ if (defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) { $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s", array('is_featured'))); } } }