WC_Countries::shipping_to_prefix()
Gets the correct string for shipping - either 'to the' or 'to'.
Method of the class: WC_Countries{}
Hooks from the method
Return
String
.
Usage
$WC_Countries = new WC_Countries(); $WC_Countries->shipping_to_prefix( $country_code );
- $country_code(string)
- Country code.
Default: ''
WC_Countries::shipping_to_prefix() WC Countries::shipping to prefix code WC 9.4.2
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 ); }