WC_Countries::shipping_to_prefix() public WC 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 Countries::shipping to prefix WC 5.0.0
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 );
}