LocationList.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Onboarding\Helpers; |
| 4 | |
| 5 | /** |
| 6 | * Normalize format of location type lists. |
| 7 | * @since 2.8.0 |
| 8 | */ |
| 9 | class LocationList { |
| 10 | |
| 11 | public static function getCountries() { |
| 12 | $countries = give_get_country_list(); |
| 13 | unset( $countries[''] ); |
| 14 | return FormatList::fromKeyValue( $countries ); |
| 15 | } |
| 16 | |
| 17 | public static function getStates( $country ) { |
| 18 | $states = give_get_states( $country ); |
| 19 | $states[''] = sprintf( '%s...', esc_html__( 'Select', 'give' ) ); |
| 20 | return FormatList::fromKeyValue( $states ); |
| 21 | } |
| 22 | } |
| 23 |