WC_Countries::get_continents │ public │ WC 1.0

Get all continents.

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

Хуки из метода

Возвращает

array.

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

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

Код WC_Countries::get_continents() WC 11.2.2

public function get_continents() {
	$locale = $this->get_cache_locale();

	if ( empty( $this->geo_cache['continents'][ $locale ] ) ) {
		if ( isset( $this->geo_cache_building['continents'][ $locale ] ) ) {
			return array();
		}

		$this->geo_cache_building['continents'][ $locale ] = true;

		try {
			/**
			 * Allows filtering of continents in WC.
			 *
			 * @since 2.6.0
			 *
			 * @param array[array] $continents
			 */
			$this->geo_cache['continents'][ $locale ] = apply_filters( 'woocommerce_continents', include WC()->plugin_path() . '/i18n/continents.php' );
		} finally {
			unset( $this->geo_cache_building['continents'][ $locale ] );
		}
	}

	return $this->geo_cache['continents'][ $locale ];
}