Function Reference: geodir_location_deactivation
Summary
Plugin deactivation Function.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
- $plugin_prefix
- (string) (required) Geodirectory plugin table prefix.
- Default: None
Package
GeoDirectory_Location_Manager
Change Log
Since: 1.0.0
Source File
geodir_location_deactivation() is located in geodir_location_manager/geodir_location_hooks_actions.php [Line: 232]
Source Code
function geodir_location_deactivation() { global $wpdb,$plugin_prefix; $default_location = geodir_get_default_location(); $post_types = geodir_get_posttypes(); if(!empty($post_types)){ foreach($post_types as $post_type) { $table = $plugin_prefix.$post_type.'_detail'; $wpdb->query($wpdb->prepare("UPDATE ".$table." SET post_location_id='0' WHERE post_location_id=%d",array($default_location->location_id))); } } $default_location->location_id = 0; update_option('geodir_default_location', $default_location); }