WC_Countries::get_states( string $cc = null )

Get the states for a country.


Description Description


Parameters Parameters

$cc

(Optional) Country code.

Default value: null


Top ↑

Return Return

(false|array) of states


Top ↑

Source Source

File: includes/class-wc-countries.php

	public function get_states( $cc = null ) {
		if ( ! isset( $this->states ) ) {
			$this->states = apply_filters( 'woocommerce_states', include WC()->plugin_path() . '/i18n/states.php' );
		}

		if ( ! is_null( $cc ) ) {
			return isset( $this->states[ $cc ] ) ? $this->states[ $cc ] : false;
		} else {
			return $this->states;
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.