Function Reference: geodir_event_uninstall

Summary

This function has not been documented yet.

Actions

‘geodir_after_post_type_deleted’ [Line: 131]

Source File

geodir_event_uninstall() is located in geodir_event_manager/gdevents-admin/admin_functions.php [Line: 66]

Source Code

function geodir_event_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!!' , GEODIREVENTS_TEXTDOMAIN) ); printf( '%s
%s

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

'; ?>
'; ?>
$posttype, 'posts_per_page' => -1, 'post_status' => 'any', 'post_parent' => null ); $geodir_all_posts = get_posts( $args ); if(!empty($geodir_all_posts)){ foreach($geodir_all_posts as $posts) { wp_delete_post($posts->ID); } } do_action('geodir_after_post_type_deleted', $posttype); $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s",array($posttype))); $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type=%s",array($posttype))); $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ADVANCE_SEARCH_TABLE." WHERE post_type=%s",array($posttype))); $wpdb->query("DROP TABLE ".$plugin_prefix.$posttype.'_detail'); $wpdb->query("DROP TABLE ".$plugin_prefix.'event_schedule'); $default_options = geodir_event_general_setting_options(); if(!empty($default_options)){ foreach($default_options as $value){ if(isset($value['id']) && $value['id'] != '') delete_option($value['id'], ''); } } } }