WC_Countries::shipping_to_prefix( string $country_code = '' )
Gets the correct string for shipping – either ‘to the’ or ‘to’.
Description Description
Parameters Parameters
- $country_code
-
(Optional) Country code.
Default value: ''
Return Return
(string)
Source Source
File: includes/class-wc-countries.php
public function shipping_to_prefix( $country_code = '' ) { $country_code = $country_code ? $country_code : WC()->customer->get_shipping_country(); $countries = array( 'GB', 'US', 'AE', 'CZ', 'DO', 'NL', 'PH', 'USAF' ); $return = in_array( $country_code, $countries, true ) ? __( 'to the', 'woocommerce' ) : __( 'to', 'woocommerce' ); return apply_filters( 'woocommerce_countries_shipping_to_prefix', $return, $country_code ); }