WC_Countries::get_countries()publicWC 1.0

Get all countries.

Method of the class: WC_Countries{}

Return

Array.

Usage

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

WC_Countries::get_countries() code WC 9.4.2

public function get_countries() {
	if ( empty( $this->geo_cache['countries'] ) ) {
		/**
		 * Allows filtering of the list of countries in WC.
		 *
		 * @since 1.5.3
		 *
		 * @param array $countries
		 */
		$this->geo_cache['countries'] = apply_filters( 'woocommerce_countries', include WC()->plugin_path() . '/i18n/countries.php' );
		if ( apply_filters( 'woocommerce_sort_countries', true ) ) {
			wc_asort_by_locale( $this->geo_cache['countries'] );
		}
	}

	return $this->geo_cache['countries'];
}