Function Reference: geodir_get_limited_country_dl

Summary

Get countries in a dropdown.

Global Values

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

Default: None

Package

GeoDirectory_Location_Manager

Parameters

($selected_option) (required)

Default: None

Change Log

Since: 1.0.0

Source File

geodir_get_limited_country_dl() is located in geodir_location_manager/geodir_location_functions.php [Line: 523]

Source Code

function geodir_get_limited_country_dl( $selected_option ) {
	global $wpdb;

	$selected = '';
	$countries = geodir_get_countries_array( 'saved_option' );

	$out_put = '';
	$countries_ISO2 = $wpdb->get_results( "SELECT Country, ISO2 FROM " . GEODIR_COUNTRIES_TABLE );

	foreach( $countries_ISO2 as $c2 ) {
		$ISO2[$c2->Country] = $c2->ISO2;
	}

	foreach( $countries as $country ) {
		$ccode = $ISO2[$country];
		$selected = '';
		if( $selected_option == $country ) {
			$selected = ' selected="selected" ';
		}

		$out_put .= '';
    }

	echo $out_put;
}