【发布时间】:2022-02-22 00:33:17
【问题描述】:
我目前在我的子主题的 functions.php 文件中有一些代码,它应该在我的 WooCommerce 结帐页面上将“帐单详细信息”更改为“运输详细信息”。
但是,当我更新到 WooCommerce 3.0 时,代码 sn-p 停止工作。下面是我使用的代码。
function wc_billing_field_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Billing Details' :
$translated_text = __( 'Shipping Details', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );
我真的很想要一个适用于 WooCommerce 3.0+ 的代码 sn-p。
【问题讨论】:
标签: php wordpress woocommerce translation checkout