Tribe__Languages__Locations::build_us_states_array()

Get a translated array of US States.

Contents


Return

(array) List of States

  • 'state_abbreviation'
    (string) State.


Top ↑

Source

File: src/Tribe/Languages/Locations.php

	public function build_us_states_array() {
		$states = array(
			'AL' => esc_html__( 'Alabama', 'tribe-common' ),
			'AK' => esc_html__( 'Alaska', 'tribe-common' ),
			'AZ' => esc_html__( 'Arizona', 'tribe-common' ),
			'AR' => esc_html__( 'Arkansas', 'tribe-common' ),
			'CA' => esc_html__( 'California', 'tribe-common' ),
			'CO' => esc_html__( 'Colorado', 'tribe-common' ),
			'CT' => esc_html__( 'Connecticut', 'tribe-common' ),
			'DE' => esc_html__( 'Delaware', 'tribe-common' ),
			'DC' => esc_html__( 'District of Columbia', 'tribe-common' ),
			'FL' => esc_html__( 'Florida', 'tribe-common' ),
			'GA' => esc_html__( 'Georgia', 'tribe-common' ),
			'HI' => esc_html__( 'Hawaii', 'tribe-common' ),
			'ID' => esc_html__( 'Idaho', 'tribe-common' ),
			'IL' => esc_html__( 'Illinois', 'tribe-common' ),
			'IN' => esc_html__( 'Indiana', 'tribe-common' ),
			'IA' => esc_html__( 'Iowa', 'tribe-common' ),
			'KS' => esc_html__( 'Kansas', 'tribe-common' ),
			'KY' => esc_html__( 'Kentucky', 'tribe-common' ),
			'LA' => esc_html__( 'Louisiana', 'tribe-common' ),
			'ME' => esc_html__( 'Maine', 'tribe-common' ),
			'MD' => esc_html__( 'Maryland', 'tribe-common' ),
			'MA' => esc_html__( 'Massachusetts', 'tribe-common' ),
			'MI' => esc_html__( 'Michigan', 'tribe-common' ),
			'MN' => esc_html__( 'Minnesota', 'tribe-common' ),
			'MS' => esc_html__( 'Mississippi', 'tribe-common' ),
			'MO' => esc_html__( 'Missouri', 'tribe-common' ),
			'MT' => esc_html__( 'Montana', 'tribe-common' ),
			'NE' => esc_html__( 'Nebraska', 'tribe-common' ),
			'NV' => esc_html__( 'Nevada', 'tribe-common' ),
			'NH' => esc_html__( 'New Hampshire', 'tribe-common' ),
			'NJ' => esc_html__( 'New Jersey', 'tribe-common' ),
			'NM' => esc_html__( 'New Mexico', 'tribe-common' ),
			'NY' => esc_html__( 'New York', 'tribe-common' ),
			'NC' => esc_html__( 'North Carolina', 'tribe-common' ),
			'ND' => esc_html__( 'North Dakota', 'tribe-common' ),
			'OH' => esc_html__( 'Ohio', 'tribe-common' ),
			'OK' => esc_html__( 'Oklahoma', 'tribe-common' ),
			'OR' => esc_html__( 'Oregon', 'tribe-common' ),
			'PA' => esc_html__( 'Pennsylvania', 'tribe-common' ),
			'RI' => esc_html__( 'Rhode Island', 'tribe-common' ),
			'SC' => esc_html__( 'South Carolina', 'tribe-common' ),
			'SD' => esc_html__( 'South Dakota', 'tribe-common' ),
			'TN' => esc_html__( 'Tennessee', 'tribe-common' ),
			'TX' => esc_html__( 'Texas', 'tribe-common' ),
			'UT' => esc_html__( 'Utah', 'tribe-common' ),
			'VT' => esc_html__( 'Vermont', 'tribe-common' ),
			'VA' => esc_html__( 'Virginia', 'tribe-common' ),
			'WA' => esc_html__( 'Washington', 'tribe-common' ),
			'WV' => esc_html__( 'West Virginia', 'tribe-common' ),
			'WI' => esc_html__( 'Wisconsin', 'tribe-common' ),
			'WY' => esc_html__( 'Wyoming', 'tribe-common' ),
		);

		// Perform a natural sort, ensures the states are in the expected order even once translated.
		natsort( $states );

		/**
		 * Filter that allows to change the names of US states before output.
		 *
		 * @since 4.7.12
		 *
		 * @param array Associative array with the format: State Code => State Name
		 */
		return (array) apply_filters( 'tribe_us_states', $states );
	}