WC_Countries::get_shipping_countries() public WC 1.0
Get countries that the store ships to.
{} Это метод класса: WC_Countries{}
Хуки из метода
Возвращает
Массив
. Ничего.
Использование
$WC_Countries = new WC_Countries(); $WC_Countries->get_shipping_countries();
Код WC_Countries::get_shipping_countries() WC Countries::get shipping countries WC 5.2.2
public function get_shipping_countries() {
if ( '' === get_option( 'woocommerce_ship_to_countries' ) ) {
return $this->get_allowed_countries();
}
if ( 'all' === get_option( 'woocommerce_ship_to_countries' ) ) {
return $this->countries;
}
$countries = array();
$raw_countries = get_option( 'woocommerce_specific_ship_to_countries' );
if ( $raw_countries ) {
foreach ( $raw_countries as $country ) {
$countries[ $country ] = $this->countries[ $country ];
}
}
return apply_filters( 'woocommerce_countries_shipping_countries', $countries );
}