[2.5] Prevent notice in get_allowed_countries

This commit is contained in:
Mike Jolley 2016-02-01 12:04:30 +00:00
parent 75e6667318
commit 8d0591d7c6
1 changed files with 5 additions and 3 deletions

View File

@ -160,10 +160,12 @@ class WC_Countries {
$countries = array();
$raw_countries = get_option( 'woocommerce_specific_allowed_countries' );
$raw_countries = get_option( 'woocommerce_specific_allowed_countries', array() );
foreach ( $raw_countries as $country ) {
$countries[ $country ] = $this->countries[ $country ];
if ( $raw_countries ) {
foreach ( $raw_countries as $country ) {
$countries[ $country ] = $this->countries[ $country ];
}
}
return apply_filters( 'woocommerce_countries_allowed_countries', $countries );