【发布时间】:2016-12-08 20:50:17
【问题描述】:
在我的设计中,我有非标准的计费字段标签和标记。例如“城镇/城市*”应该是“省*”。
我使用了 WOO 文档,并过滤了woocommerce_billing_fields。它适用于类名、占位符、创建新字段。但我无法更改标签。
$out_arr['billing_city']['class'][0] = 'form-row-first';
$out_arr['billing_city']['label'] = __('Province', 'woocommerce');
$out_arr['billing_postcode']['label'] = __('Zipcode', 'woocommerce');
并使用新的$out_arr 数组中的var_dump 显示正确的标签
["billing_city"]=>
array(4) {
["label"]=>
string(8) "Province"
["required"]=>
bool(true)
["class"]=>
array(2) {
[0]=>
string(14) "form-row-first"
[1]=>
string(13) "address-field"
}
["autocomplete"]=>
string(14) "address-level2"
}
但我在前端仍然有旧标签。请问有什么建议吗?
【问题讨论】:
标签: php wordpress woocommerce checkout custom-fields