Function Reference: geodir_get_location_switcher

Parameters

$args
(null) (required)

Default: None

Source File

geodir_get_location_switcher() is located in geodir_location_manager/geodir_location_template_tags.php [Line: 317]

Source Code

function geodir_get_location_switcher($args = null)
{
	$defaults = array(
		'country_default_list' => '',
		'country_text_filter' => true,
		'country_column' => true, 
		'region_default_list' => '', 
		'region_text_filter' => true,
		'region_column' => true,
		'city_default_list' => '', 
		'city_text_filter' => true,
		'city_column' => true, 
		 
	);
	
	// location picker config arguments
	$l_p_config = wp_parse_args( $args, $defaults );
	
	if(get_option('geodir_enable_country') =='default')
		$l_p_config['country_column'] = false ; 
	
	if(get_option('geodir_enable_region') =='default')
		$l_p_config['region_column'] = false ; 
			
	$base_location_link = geodir_get_location_link('base');
?>
	

    'country' , 'city_val' => '', 'region_val' => '', 'country_val' => '' , 'compare_operator' =>'in' , 'country_column_name' => 'country' , 'region_column_name' => 'region' , 'city_column_name' => 'city' , 'location_link_part' => true , 'order_by' => ' asc ', 'no_of_records' => '', 'format' => array('type' => 'array') ) ; $country_loc_array = geodir_get_location_array($country_args); if(!empty($country_loc_array)) { foreach($country_loc_array as $country_item ) { ?>
  • country, GEODIRECTORY_TEXTDOMAIN ) ;?>  

    'region' , 'city_val' => '', 'region_val' => '', 'country_val' => '' , 'compare_operator' =>'in' , 'country_column_name' => 'country' , 'region_column_name' => 'region' , 'city_column_name' => 'city' , 'location_link_part' => true , 'order_by' => ' asc ', 'no_of_records' => '', 'format' => array('type' => 'array') ) ; $region_loc_array = geodir_get_location_array($region_args); if(!empty($region_loc_array)) { foreach($region_loc_array as $region_item ) { ?>
  • region, GEODIRECTORY_TEXTDOMAIN ) ;?>  

    'city' , 'city_val' => '', 'region_val' => '', 'country_val' => '' , 'compare_operator' =>'in' , 'country_column_name' => 'country' , 'region_column_name' => 'region' , 'city_column_name' => 'city' , 'location_link_part' => true , 'order_by' => ' asc ', 'no_of_records' => '', 'format' => array('type' => 'array') ) ; $city_loc_array = geodir_get_location_array($city_args); if(!empty($city_loc_array)) { foreach($city_loc_array as $city_item ) { ?>
  • city, GEODIRECTORY_TEXTDOMAIN ) ;?>