Function Reference: geodir_location_get_iso2
Summary
Get ISO2 country code for the given country.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
Package
GeoDirectory_Location_Manager
Parameters
- $country
- (string) (required) Country name.
- Default: None
Return Values
- (null|string)
Change Log
Since: 1.0.0
Source File
geodir_location_get_iso2() is located in geodir_location_manager/geodir_location_functions.php [Line: 445]
Source Code
function geodir_location_get_iso2( $country ) { global $wpdb; $sql = $wpdb->prepare( "SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country LIKE %s", $country ); $result = $wpdb->get_var( $sql ); return $result; }