Function Reference: geodir_get_countries_array

Summary

Returns countries array.

Global Values

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

Default: None

Package

GeoDirectory_Location_Manager

Parameters

$from
(string) (required) Get countries from table or option?.

Default: None

Return Values

(array)
  • Countries array.

Change Log

Since: 1.0.0

Source File

geodir_get_countries_array() is located in geodir_location_manager/geodir_location_functions.php [Line: 496]

Source Code

function geodir_get_countries_array( $from = 'table' ) {
	global $wpdb;

	if( $from == 'table' ) {
		$countries = $wpdb->get_col( "SELECT Country FROM " . GEODIR_COUNTRIES_TABLE );
	} else {
		$countries = get_option( 'geodir_selected_countries' );
	}
	$countires_array = '' ;
	foreach( $countries as $key => $country ) {
		$countires_array[$country] = __( $country, GEODIRECTORY_TEXTDOMAIN ) ;
	}
	asort($countires_array);

	return $countires_array ;
}