WordPress at Your Fingertips
function is not described

WC_Countries::get_shipping_continents() public WC 3.6.0

Get continents that the store ships to.

{} It's a method of the class: WC_Countries{}

No Hooks.

Return

Array.

Usage

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

Changelog

Since 3.6.0 Introduced.

Code of WC_Countries::get_shipping_continents() WC 5.6.0

public function get_shipping_continents() {
	$continents             = $this->get_continents();
	$shipping_countries     = $this->get_shipping_countries();
	$shipping_country_codes = array_keys( $shipping_countries );
	$shipping_continents    = array();

	foreach ( $continents as $continent_code => $continent ) {
		if ( count( array_intersect( $continent['countries'], $shipping_country_codes ) ) ) {
			$shipping_continents[ $continent_code ] = $continent;
		}
	}

	return $shipping_continents;
}