我目前在我的孩子主题的functions.php文件中有一些代码,它应该在我的Woocommerce结帐页面上更改"账单明细"以说明"发货明细".
但是,当我更新到Woocommerce 3.0时,代码片段停止工作.以下是我使用的代码.
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 );
Run Code Online (Sandbox Code Playgroud)
我真的很喜欢与Woocommerce 3.0一起使用的代码片段.
非常感谢!