WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Countries::get_allowed_countries() public WC 1.0

Get countries that the store sells to.

Это метод класса: WC_Countries{}

Хуки из метода
Возвращает

Массив.

Использование

$WC_Countries = new WC_Countries();
$WC_Countries->get_allowed_countries();

Код WC Countries::get allowed countries: woocommerce/includes/class-wc-countries.php WC 4.5.2

<?php
public function get_allowed_countries() {
	if ( 'all' === get_option( 'woocommerce_allowed_countries' ) ) {
		return apply_filters( 'woocommerce_countries_allowed_countries', $this->countries );
	}

	if ( 'all_except' === get_option( 'woocommerce_allowed_countries' ) ) {
		$except_countries = get_option( 'woocommerce_all_except_countries', array() );

		if ( ! $except_countries ) {
			return $this->countries;
		} else {
			$all_except_countries = $this->countries;
			foreach ( $except_countries as $country ) {
				unset( $all_except_countries[ $country ] );
			}
			return apply_filters( 'woocommerce_countries_allowed_countries', $all_except_countries );
		}
	}

	$countries = array();

	$raw_countries = get_option( 'woocommerce_specific_allowed_countries', array() );

	if ( $raw_countries ) {
		foreach ( $raw_countries as $country ) {
			$countries[ $country ] = $this->countries[ $country ];
		}
	}

	return apply_filters( 'woocommerce_countries_allowed_countries', $countries );
}