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)
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; }