Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WC_Admin_Setup_Wizard::get_postcodes()

Helper method to get postcode configurations from WC()->countries->get_country_locale().


Description Description

We don’t use wp_list_pluck because it will throw notices when postcode configuration is not defined for a country.


Return Return

(array)


Top ↑

Source Source

File: includes/admin/class-wc-admin-setup-wizard.php

	private function get_postcodes() {
		$locales   = WC()->countries->get_country_locale();
		$postcodes = array();
		foreach ( $locales as $country_code => $locale ) {
			if ( isset( $locale['postcode'] ) ) {
				$postcodes[ $country_code ] = $locale['postcode'];
			}
		}
		return $postcodes;
	}

Top ↑

User Contributed Notes User Contributed Notes

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