Function Reference: geodir_cpt_remove_location_search

Summary

Remove terms from location search request.

Global Values

$dist
(int) (required) Distance in range to search.

Default: None
$mylat
(string) (required) Geo latitude.

Default: None
$mylon
(string) (required) Geo longitude.

Default: None
$snear
(string) (required) Nearest place to search.

Default: None

Change Log

Since: 1.1.6

Source File

geodir_cpt_remove_location_search() is located in geodir_custom_posts/geodir_cp_functions.php [Line: 1412]

Source Code

function geodir_cpt_remove_location_search() {
	$search_posttype = isset( $_REQUEST['stype'] ) ? $_REQUEST['stype'] : geodir_get_current_posttype();
	
	if ( geodir_cpt_no_location( $search_posttype ) ) {	
		global $dist, $mylat, $mylon, $snear;
		$dist = $mylat = $mylon = $snear = '';
		
		if ( isset( $_REQUEST['snear'] ) ) {
			unset( $_REQUEST['snear'] );
		}
		
		if ( isset( $_REQUEST['sgeo_lat'] ) ) {
			unset( $_REQUEST['sgeo_lat'] );
		}
			
		if ( isset( $_REQUEST['sgeo_lon'] ) ) {
			unset( $_REQUEST['sgeo_lon'] );
		}
	}
}