WC_Countries::shipping_to_prefix()publicWC 1.0

Gets the correct string for shipping - either 'to the' or 'to'.

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

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

Возвращает

Строку.

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

$WC_Countries = new WC_Countries();
$WC_Countries->shipping_to_prefix( $country_code );
$country_code(строка)
Country code.
По умолчанию: ''

Код WC_Countries::shipping_to_prefix() WC 8.7.0

public function shipping_to_prefix( $country_code = '' ) {
	$country_code = $country_code ? $country_code : WC()->customer->get_shipping_country();
	$countries    = array( 'AE', 'CZ', 'DO', 'GB', 'NL', 'PH', 'US', 'USAF' );
	$return       = in_array( $country_code, $countries, true ) ? _x( 'to the', 'shipping country prefix', 'woocommerce' ) : _x( 'to', 'shipping country prefix', 'woocommerce' );

	return apply_filters( 'woocommerce_countries_shipping_to_prefix', $return, $country_code );
}