Function Reference: geodir_change_cat_location

Summary

Change category location.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None

Package

GeoDirectory_Location_Manager

Change Log

Since: 1.0.0

Source File

geodir_change_cat_location() is located in geodir_location_manager/geodir_location_functions.php [Line: 2474]

Source Code

function geodir_change_cat_location() {
	global $wpdb;

	$wpnonce = isset($_REQUEST['wpnonce']) ? $_REQUEST['wpnonce'] : '';
	$gd_location = isset($_REQUEST['locid']) ? (int)$_REQUEST['locid'] : '';
	$term_id = isset($_REQUEST['catid']) ? (int)$_REQUEST['catid'] : '';
	$post_type = isset($_REQUEST['posttype']) ? $_REQUEST['posttype'] : '';

	if(is_admin() && $wpnonce && current_user_can( 'manage_options' ) && $gd_location>0 && $term_id>0 && $post_type) {
		$option_name = 'geodir_cat_loc_'.$post_type.'_'.$term_id.'_'.$gd_location;
		$option = get_option($option_name);
		$gd_cat_loc_desc = !empty($option) && isset($option['gd_cat_loc_desc']) ? $option['gd_cat_loc_desc'] : '';
		echo stripslashes_deep($gd_cat_loc_desc);
		exit;
	}
	echo 'FAIL';
	exit;
}