function nzshpcrt_region_list($selected_country = null, $selected_region = null) { global $wpdb; if ($selected_region == null) { $selected_region = get_option('base_region'); } $output = ""; $region_list = WPSC_Countries::get_regions($selected_country, true); if ($region_list != null) { foreach ($region_list as $region) { if ($selected_region == $region['id']) { $selected = "selected='selected'"; } else { $selected = ""; } $output .= "<option value='" . $region['id'] . "' {$selected}>" . $region['name'] . "</option>\r\n"; } } else { $output .= "<option value=''>" . esc_html__('None', 'wpsc') . "</option>\r\n"; } return $output; }