Increase radius limit above 100

Thank you for waiting. This issue is in the bug tracker, and we will fix it as soon as possible. As a temporary fix, please try this PHP snippet.

add_filter( 
	'hivepress/v1/forms/listing_filter', 
	function($form){
		if(isset($form['fields']['_radius'])){
			$form['fields']['_radius']['max_value'] = 1000;
		}
		
		return $form;
	},
	1000 
);

remove_filter( 'option_hp_geolocation_radius', [ hivepress()->geolocation, 'set_search_radius' ] );
add_filter( 
	'option_hp_geolocation_radius', 
	function($value){
		if ( get_option( 'hp_geolocation_allow_radius' ) ) {
			$radius = absint( hivepress()->helper->get_array_value( $_GET, '_radius' ) );

			if ( $radius >= 1 ) {
				$value = $radius;
			}
		}

		return $value;
	},
	1000
);
1 Like