Add context to countries shipping to prefix (#36254)

Closes https://github.com/woocommerce/woocommerce/issues/36242
This commit is contained in:
Matthias Kittsteiner 2023-01-17 10:39:10 +01:00 committed by GitHub
parent d9daad3e9c
commit 0f78e32216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: enhancement
Add context to countries shipping to prefix

View File

@ -410,7 +410,7 @@ class WC_Countries {
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 ) ? __( 'to the', 'woocommerce' ) : __( 'to', 'woocommerce' );
$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 );
}